r/PythonLearning • • 6d 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

3

u/Fluffy_white_fox 6d 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

1

u/Less_Juggernaut9361 3d ago

Stop posting this retarded shit I would straight up bitch slap anyone who committed something like this to a codebase, you’re not helping people learn with this esoteric bullshit

0

u/bra1n_gym 6d ago

3**2 is 9

1

u/Orgasml 6d ago

Except it's 2**3