map的用法Python

map(func,Iter)

例如:
def a(n):
return n+'_sb'

name=['alex','wupeiqi','wuhao','nezha']
print(list(map(a,name)))

输出要list,否则只是返回内存地址

原文地址:https://www.cnblogs.com/fengxiongmiao/p/12180909.html