Skip to content

Instantly share code, notes, and snippets.

@klement97
Last active April 15, 2019 00:22
Show Gist options
  • Save klement97/9b8df2d04ee4821b3ebe6f8cc4c29eb6 to your computer and use it in GitHub Desktop.
Save klement97/9b8df2d04ee4821b3ebe6f8cc4c29eb6 to your computer and use it in GitHub Desktop.
Prints out first n numbers of fibonacci sequence. Try smth like 1000 or 10 000 if you have some time and check out its length!
n = int(input("enter n: "))
number = []
number.append(1)
number.append(1)
print(number[0])
print(number[1])
for i in range(2, n):
number.append(number[i-1] + number[i-2])
print(number[i])
print("number of digits: ", len(str(number[n-1])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment