Why my second lambda function is not work | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why my second lambda function is not work

# add with lambda add = lambda a,b: a + b print(add(4,5)) even =""lambda a: a%2==0 print(even(10))

27th Aug 2018, 3:44 PM
Prateik Jindal
Prateik Jindal - avatar
3 Answers
+ 2
The only wrong Thing I can see are the quotation marks in the second Function. add = lambda a,b: a + b print(add(4,5)) Output is '9', that's right. even = lambda a: a%2==0 print(even(10)) Output is 'True', that's right, too.
27th Aug 2018, 7:42 PM
Sebastian Keßler
Sebastian Keßler - avatar
0
Sebastian can you also solve this def to_power(num , *args): if args: return (i**num for i in args) else: return "U didn't pass any input'" print(to_power(2, *[2,3,4]))
28th Aug 2018, 3:37 AM
Prateik Jindal
Prateik Jindal - avatar
0
i unpacked the list but still this not working
28th Aug 2018, 3:38 AM
Prateik Jindal
Prateik Jindal - avatar