map函数类似一个生成器
具体用例如下:
def add(x):
return x** a =[,,]
b = map(add,[,,])
print( list(map(add,[,,])) )
print(b,type(b))
for i in b:
print(i)
对应结果为
[, , ]
<map object at 0x000000000396D320> <class 'map'>
2023-10-08 09:43:16
map函数类似一个生成器
具体用例如下:
def add(x):
return x** a =[,,]
b = map(add,[,,])
print( list(map(add,[,,])) )
print(b,type(b))
for i in b:
print(i)
对应结果为
[, , ]
<map object at 0x000000000396D320> <class 'map'>