demo_ref_map2.py:
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))
C:\Users\My Name>python demo_map2.py
<map object at 0x034244F0>
['appleorange', 'bananalemon', 'cherrypineapple']