Q. Write python that create a tuple storing first 9 term of Fibonacci series.


You can understand by Watching video :-



Answer :-

fib = (0,1,1)

for i in range(6):
    fib = fib + ( fib [ i +1] + fib [ i + 2 ] ,)

print(fib)

Output :-

(0, 1, 1, 2, 3, 5, 8, 13, 21)
>>>


1 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post