map

map 用法很简单,只是 python3 和 python2 有点不同

python2

map(str, range(3))    # ['0', '1', '2']

python3

a = map(str, range(3))
print(a)    # <map object at 0x0000000003663288>

b = list(a)
print(b)    # ['0', '1', '2']
原文地址:https://www.cnblogs.com/yanshw/p/14311851.html