Examveda

What will be the output of the following Python code?
a = [1, 2, 3, 4, 5]
b = lambda x: (b (x[1:]) + x[:1] if x else []) 
print(b (a))

A. 1 2 3 4 5

B. [5,4,3,2,1]

C. []

D. Error, lambda functions can't be called recursively

Answer: Option C


This Question Belongs to Python Program >> Functions In Python

Join The Discussion

Related Questions on Functions in Python