Last active
May 21, 2024 19:45
-
-
Save orjanv/13dc1a595f6682533edc92844d101b9e to your computer and use it in GitHub Desktop.
Finn tallene i fibonacci-rekken
This file contains hidden or 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
TALL = 15 | |
fibonacci = [] | |
for i in range(0, TALL + 1): | |
if i < 2: | |
fibonacci.append(i) | |
else: | |
fibonacci.append(fibonacci[i - 1] + fibonacci[i - 2]) | |
print(f'Fibonaccitallene: {fibonacci}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment