Skip to content

Instantly share code, notes, and snippets.

@Ra1d7
Created January 31, 2017 00:07
Show Gist options
  • Save Ra1d7/3178376802c1d8621f0889e9538caf45 to your computer and use it in GitHub Desktop.
Save Ra1d7/3178376802c1d8621f0889e9538caf45 to your computer and use it in GitHub Desktop.
Generate fibonacci numbers (execrise 13)
num=int(input('Enter a number:'))
length=int(input('To what length u want it to be?:'))
nuz=0
list=[]
if len(str(num))>0:
list.append (num)
r=num+nuz
list.append (r)
while len(list)!=length:
dd=list[nuz]+list[nuz+1]
list.append (dd)
nuz += 1
if len(list)==length:
break
print (list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment