Python Forum
Multiplicate several numbers
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiplicate several numbers
#6
(Oct-05-2018, 08:40 AM)Student0 Wrote: Thanks for answer, but it didnt work :/
Do you have other suggestions? :)

[Image: kCqm92f]

Please just share code in the future. If you had done so, pretty much anyone could have told you what the issue was lol.
You're overwriting func when you do func = something. Instead, multiply it by itself, like func = func * something, or, using the shorthand, func *= something.

I'll type your code here, so it isn't just in the picture:
Quote:
n = 1
func = 1

while n < 19:
    n = n + 1
    calculated_value = func * func
    func = (1 + 1/n**2)
    print(func)

print(func)
print("Calculated Value = ", calculated_value)
Reply


Messages In This Thread
Multiplicate several numbers - by Student0 - Oct-04-2018, 09:13 PM
RE: Multiplicate several numbers - by nilamo - Oct-04-2018, 09:34 PM
RE: Multiplicate several numbers - by Student0 - Oct-05-2018, 08:40 AM
RE: Multiplicate several numbers - by gruntfutuk - Oct-05-2018, 09:41 AM
RE: Multiplicate several numbers - by nilamo - Oct-09-2018, 05:35 PM
RE: Multiplicate several numbers - by buran - Oct-05-2018, 08:56 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Print Numbers starting at 1 vertically with separator for output numbers Pleiades 3 3,757 May-09-2019, 12:19 PM
Last Post: Pleiades

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020