User Profile
Collapse
-
Can you put it in simpler terms? I know i need to put something before the for loop. -
Using an accumulator instead of exponential(**) in python.
Here is my current code:
It uses an equation to figure out the Fibonacci Sequence. However, I need to use an accumulator instead of the exponential ( ** i) to get the same results. Can someone...Code:def fibClosed(): n=input("Enter a maximum value of n you'd like to compute") for i in range (n+1): x= round((1 / math.sqrt(5)) * ((1+math.sqrt(5))/2) ** i) print i, int(x) , type(i)
No activity results to display
Show More
Leave a comment: