+ 10
what is a result
def add_five(x): return x + 199 nums = [111, 22, 33, 449, 55] result = list(map(add_five, nums)) print(result)
2 Réponses
+ 4
The map function just applies add_five() to every element of ‘nums’ and then list() makes an array from the resulting numbers. So, ‘result’ will store the following list: [310, 221, 232, 648, 254]
(Just every number from ‘nums’ plus 199)
+ 5
310 221 232 648 254