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
|
494 Discussions
|
Please Login in order to post a comment
Absolutely, let’s go! 🙌 Python is such a powerful and fun language to work with. Whether it's data structures, decorators, list comprehensions, or even diving into async programming! Tigerexch247 com Login
cube = lambda x: x**3 # complete the lambda function
def fibonacci(n): # return a list of fibonacci numbers if n==0: return []
if name == 'main': n = int(input()) print(list(map(cube, fibonacci(n))))
cube = lambda x: x ** 3
def fibonacci(n): a,b=0,1 count = 0 while count < n: yield a a,b=b, a+b count+=1
if name == 'main': n = int(input()) print(list(map(cube, fibonacci(n)))) `