f=[0,1]
n=int(input("enter the number "))
for i in range(2,n):
fi=f[i-1]+f[i-2]
f.append(fi)
print(f)
## upto 12 index
output :-
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
This blog has content related to python programing language and Automation with python and hacker rank solutions , leet code solution
Comments
Post a Comment