0

Can someone help with lambda? It's being annoying

https://code.sololearn.com/cZnN8t46jEhd/?ref=app

21st Jun 2023, 6:27 PM
Podle Playz
Podle Playz - avatar
6 Réponses
+ 1
#use list and filter to get all numbers which are a multible of 11 print(list(filter(lambda x: x%11==0, x)))
23rd Jun 2023, 7:04 AM
Angela
Angela - avatar
+ 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.
21st Jun 2023, 6:37 PM
Lisa
Lisa - avatar
+ 1
Ok thx
21st Jun 2023, 6:38 PM
Podle Playz
Podle Playz - avatar
+ 1
Got it thanks
23rd Jun 2023, 7:06 AM
Podle Playz
Podle Playz - avatar
+ 1
Dragon RB We all learn something every day lol
24th Jun 2023, 8:14 AM
Podle Playz
Podle Playz - avatar
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?
22nd Jun 2023, 3:50 AM
Dragon RB
Dragon RB - avatar