Created
January 31, 2017 00:07
-
-
Save Ra1d7/3178376802c1d8621f0889e9538caf45 to your computer and use it in GitHub Desktop.
Generate fibonacci numbers (execrise 13)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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