Last active
April 15, 2019 00:22
-
-
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!
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
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