Created
March 29, 2021 10:45
-
-
Save MartinThoma/0022a5bb9bad2eadca89f08238f72123 to your computer and use it in GitHub Desktop.
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
from typing import List | |
def fib_list(n: int = 0) -> List[int]: | |
fib_numbers: List[int] = [0, 1] | |
for _ in range(n): | |
fib_numbers.append(fib_numbers[-1] + fib_numbers[-2]) | |
return fib_numbers | |
print(f"fib_list(10) = {fib_list(10)}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment