Saturday, 28 August 2021

Python Program : 9 : Print Fibonacci series up to n numbers e.g. 0 1 1 2 3 5 8 13…..n

PROGRAM :-
import math
a = int(input("Enter first number : "))
b = int(input("Enter second number : "))
n = int(input("Enter count : "))
print(a,b,end=' ')
for i in range(3,n+1):
    c = a + b
    print(c,end=' ')
    a = b 
    b = c

VIDEO LINK : -

No comments:

Post a Comment

Note: only a member of this blog may post a comment.