主页
Python
Python map() 函数
demo_ref_map
运行 ❯
×
更改方向
保存代码
更改主题
def myfunc(a): return len(a) x = map(myfunc, ('apple', 'banana', 'cherry')) print(x) #convert the map into a list, for readability: print(list(x))
<map object at 0x056D44F0>
['5', '6', '6']