In this HackerRank Map and Lambda Function problem solution, You have to generate a list of the first N Fibonacci numbers, 0 being the first number. Then, apply the map function and a lambda expression to cube each Fibonacci number and print the list.

HackerRank Map and Lambda Function in python problem solution

 HackerRank Map and Lambda Function in python problem solution

n = input()
arr = []
for i in range(0, n):
    if i == 0:
        arr.append(0)
    elif i == 1:    
        arr.append(1)
    else:
        arr.append(arr[i-1]+arr[i-2])
print map(lambda x: x**3, arr)