📅  最后修改于: 2022-03-11 14:47:18.909000             🧑  作者: Mango
# WARNING: this program assumes the
# fibonacci sequence starts at 1
def fib(num):
"""return the number at index num in the fibonacci sequence"""
if num <= 2:
return 1
return fib(num - 1) + fib(num - 2)
print(fib(6)) # 8