DS160123 What is the output of the following code?

Date:- 07/03/2023

y = 8
z = lambda x: x*y
print(z(6))
[a] 64 [b] 14 [c] 48 [d] none of these

3 Likes

C) 48
as y is already defined as 8 and x is passed as an argument. function returns 8*6 as result

1 Like

@sms18680
Please correct function name as lambda.
Keep learning :+1:

1 Like