主页
Python
Python map() 函数
demo_ref_map2
运行 ❯
×
更改方向
保存代码
更改主题
def myfunc(a, b): return a + b x = map(myfunc, ('apple', 'banana', 'cherry'), ('orange', 'lemon', 'pineapple')) print(x) #convert the map into a list, for readability: print(list(x))
<map object at 0x034244F0>
['appleorange', 'bananalemon', 'cherrypineapple']