Feb-17-2024, 12:09 PM
(This post was last modified: Feb-17-2024, 04:15 PM by Pedroski55.)
11 is a very strange number.
Fibonacci is a very strange sequence.
For every Fibonacci sequence of length 10, the sum of the sequence is equal to the 7th term times 11!
As long as you enter 10 in myApp() the sum of the sequence is equal to the 7th term times 11!
Fibonacci is a very strange sequence.
For every Fibonacci sequence of length 10, the sum of the sequence is equal to the 7th term times 11!
As long as you enter 10 in myApp() the sum of the sequence is equal to the 7th term times 11!
def myApp(num): if num < 7: print("Please enter a number >= 7.") return one = random.randint(1, 100) two = random.randint(1, 100) print(f'first number is {one}, the second number is {two}.') myfibo = [one, two] for n in range(2, num): nu = myfibo[n-2] + myfibo[n-1] myfibo.append(nu) for i in myfibo: print(i) print(f'the length of myfibo = {len(myfibo)}') print(f'The sum of myfibo is {sum(myfibo)}') print(f'{myfibo[6]} x 11 = {myfibo[6] * 11}') return myfibo