Python code to print Fibonacci series (1,1,2,3,5,8,13,21,34,55,89,144,233,377)
Python programming to print the Fibonacci sequence (1,1,2,3,5,8,13,21,34,55,89,144,233,377)we are going to use while loop for this tutorial, in this python tutorial we will learn how o print the Fibonacci series of numbers in Python using while loops
for the video follow this
a,b=0,1
while b<500:
print(b)
a,b=b,a+b
#or to get it in a list
c=[]
a,b=0,1
while b<500:
c.append(b)
a,b=b,a+b
print(c)
Comments
Post a Comment