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))
3 odpowiedzi
+ 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.
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]))
0
i unpacked the list but still this not working