Oct-09-2018, 05:35 PM
(Oct-05-2018, 08:40 AM)Student0 Wrote: Thanks for answer, but it didnt work :/
Do you have other suggestions? :)
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)