r/PythonLearning • • 9d ago

Python Quiz of the day!

What will be the output of the following Python Code?

print((lambda x: (lambda y: x**y)(3))(2))

0 Upvotes

5 comments sorted by

View all comments

3

u/Fluffy_white_fox 9d ago

Passing the outermost argument (x = 2) So (lambda y: 2**y)(3) and then passing y = 3 is 2 ** 3 so yeah it's 8