+ 2

[solved](python)List can't be in lambda?

Would you please check the code and help me understand why line1 get printed whereas line2 not? https://code.sololearn.com/cO7gW7YGqcZa/?ref=app

14th Nov 2021, 11:39 AM
Lea
Lea - avatar
2 Answers
+ 5
map() applies the lambda to each iterable item, but in your code, you passed <bonus> as second argument for map(), which isn't an iterable (it's an integer) The second argument of map() expected to be an iterable. https://realpython.com/JUMP_LINK__&&__python__&&__JUMP_LINK-map-function/
14th Nov 2021, 11:47 AM
Ipang
+ 2
Ok I got it. Thank you Ipang
15th Nov 2021, 5:04 AM
Lea
Lea - avatar