map函数格式:map(function, iterable, ....)
function:函数
iterable:需要传入函数里面的变量
例:
>>>def dfs(x):
... return x ** 2
...
>>>map(dfs, [1,3,4,5,7])
[1, 9, 16, 25, 49]
>>>map(lambda x: x ** 2, [1,3,4,5,7])
[1, 9, 16, 25, 49]
>>>map(lambda x, y: x + y, [1,3,4,5,7], [2,4,5,4,7])
[3,7,9,9,14]