🤔Question: What will be output?🤔 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

🤔Question: What will be output?🤔

first = lambda y, x: x*y print(first(2, 1)) # I am losing challenges, cuz of this one Pls let me know the answer

5th Nov 2017, 3:36 AM
#RahulVerma
#RahulVerma - avatar
4 Answers
+ 2
first = lambda y, x: x*y print(first(2, 1)) ### this code is equivalent to def first(y,x) : return x*y print(first(2,1)) ## and as the function first has y as 1st and x as 2nd parameter...so 2,1 means y us set to 2 and x is set to 1 ## hope you understood..
5th Nov 2017, 4:08 AM
sayan chandra
sayan chandra - avatar
+ 15
Output = 2
5th Nov 2017, 3:39 AM
Pixie
Pixie - avatar
0
2 is value for which var x or y in lambda?
5th Nov 2017, 3:52 AM
#RahulVerma
#RahulVerma - avatar
0
@ sayan chandra Thank you for this explanation
5th Nov 2017, 4:12 AM
#RahulVerma
#RahulVerma - avatar