• + 0 comments
    cube = lambda x: x**3
    
    from functools import reduce
    def fibonacci(n):
    		if n == 0:
    			return []
    		elif n == 1:
    			return [0]
        # return a list of fibonacci numbers
        res = [0, 1]
        return reduce(lambda x, _: x + [x[-2] + x[-1]], range(n - 2), res)