r/pythonhelp • u/Aryangupt556 • Aug 16 '22
problem with Fibonacci sequence stuck on zeros??
def series(n):
n1 = 0
n2 = 1
count = 0
if n <= 0:
print("enter a posotive integer")
if n >= 0:
while count <= n:
print(n1)
nth=n1+n2
n2 = n1
nth = n2
count+=1
series(5)
2
Upvotes
1
u/Aryangupt556 Aug 16 '22
its does output 0,0,0,0,0 anyone know why??