python - Write a program using while loop to calculate and print the first ‘N’ Ex=10 Fibonacci number starts with (1,1),2, 3,5,8,13,21,34,55 Email ThisBlogThis!Share to TwitterShare to Facebook Reactions: Labs 1 Comment
a=int(raw_input("number is "))
ReplyDeletes=1
r=1
b=0
t=0
while a>0:
print s
s=b+r
b=r
r=s
a=a-1
a=int(raw_input("number is "))
s=1
r=1
b=0
t=0
while a>0:
print s
s=b+r
b=r
r=s
a=a-1
number is 10
1
1
2
3
5
8
13
21
34
55
238