Fibonacci series in Python - Learning Python (6th Night)
Just run this code in any IDE, and see the output:
def fib(n):
a = 0
b = 1
print(a)
print(b)
for i in range(1,n):
c=a+b
print(a+b)
a = b
b = c
fib(10)
Just run this code in any IDE, and see the output:
def fib(n):
a = 0
b = 1
print(a)
print(b)
for i in range(1,n):
c=a+b
print(a+b)
a = b
b = c
fib(10)
Comments
Post a Comment