Vidyalelo
Python · Q36

Functions in Python

Programming · Python · question 36

Q36

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.
[]
Answer
D.
Error, lambda functions can't be called recursively

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board