Created
August 4, 2016 23:54
-
-
Save kevin-weitgenant/a8a15088b54837e8c1f1b7db1c5ff1c2 to your computer and use it in GitHub Desktop.
practicepython.org Exercise 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
def x(number): | |
fibonacci = [1, 1] | |
for _ in range(number-2): | |
last = len(fibonacci) - 1 | |
penultimo = len(fibonacci) - 2 | |
resultado = int(fibonacci[last]) + int(fibonacci[penultimo]) | |
fibonacci.append(resultado) | |
return fibonacci | |
y = int(input("How many fibonacci numbers do you want?")) | |
print(x(y)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment