0
Can someone help with lambda? It's being annoying
6 Antworten
+ 1
#use list and filter to get all numbers which are a multible of 11
print(list(filter(lambda x: x%11==0, x)))
+ 4
What is it supposed to do?
Filter x according to lambda function? Apply lambda function to each element?
print(list(map(lambda x: x % 11 == 0, x)))
print(list(filter(lambda x: x % 11 == 0, x)))
In your code you define a lambda but you don't do anything with it.
+ 1
Ok thx
+ 1
Got it thanks
+ 1
Dragon RB We all learn something every day lol
0
Lisa I didnt expect that when using map() function along with lambda with a condition like x%11==0 would return a boolean value :-) Learned something new, I guess?