Go on. Explore!
lvl 0 • 0 xp
lvl 1
from functools import reduce num = int(input("num: ")) fib = lambda n: reduce(lambda x, _: x+[x[-1]+x[-2]],range(n-2), [0, 1]) print(fib(num)) num: 7 [0, 1, 1, 2, 3, 5, 8]
0 reviews
Active users
1
All-time users
Favorites
0
Last updated
10 months ago
Date created
Oct 29, 2023