0

functional programming quiz number 4

nums = [1, 2, 8, 3, 7] res = list(---- (lambda x: x%2==0, nums)) print(res) what is fill in blank questions? and I have not XP to unluck the question

1st Nov 2020, 3:29 PM
Sahar
Sahar - avatar
2 Respostas
+ 3
If you learn about map or filter functions in python response will be one of them.I m not sure but filter is perhaps the answer.
1st Nov 2020, 3:33 PM
HBhZ_C
HBhZ_C - avatar
+ 1
Filter Will give only numbers where x%2==0 is True (even numbers), so [2, 8]
1st Nov 2020, 4:01 PM
Benjamin Jürgens
Benjamin Jürgens - avatar