• + 0 comments

    I think this is the easiest one

    Code:

    cube = lambda x: x**3 # complete the lambda function 
    
    def fibonacci(n):
        # return a list of fibonacci numbers
        fibseq = [0, 1]
    
        if n > 2:
            for i in range(2, n):
                fibseq.append(fibseq[i - 2] + fibseq[i - 1])
        else:
            fibseq = fibseq[:n]
        
        return fibseq
        
    if __name__ == '__main__':
        n = int(input())
        print(list(map(cube, fibonacci(n))))