cryptotools/Cryptotools/Numbers/numbers.py
2026-01-11 09:19:22 +01:00

20 lines
423 B
Python

#!/usr/bin/env python3
def fibonacci(n) -> list:
"""
This function generate the list of Fibonacci
Args:
n (integer): it's maximum value of Fibonacci sequence
Returns:
Return a list of n element in the Fibonacci sequence
"""
fibo = [0, 1]
fibo.append(fibo[0] + fibo[1])
for i in range(2, n):
fibo.append(fibo[i - 1] + fibo[i])
return fibo