We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Map and Lambda Function
Map and Lambda Function
Sort by
recency
|
487 Discussions
|
Please Login in order to post a comment
This is the method to make real fibonnaci # complete the lambda function def fibonacci(n): a = 0 b = 1 c = [] for i in range(1,n+1): c.append(a) d = a + b a = b b = d return c
cube = (lambda x: (x**3))
if name == 'main': n = int(input()) print(list(map(cube, fibonacci(n))))
I think this is the easiest one
Code: