You are viewing a single comment's thread. Return to all comments →
cube = lambda x: x**3 def fibonacci(n): if n == 0: return [] elif n == 1: return [0] else: list_fib=[0,1] while len(list_fib) < n: next_num=list_fib[-1]+list_fib[-2] list_fib.append(next_num) return list_fib
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Map and Lambda Function
You are viewing a single comment's thread. Return to all comments →