map returning tuples
examples/functional/map_lambda_tuples.py
numbers = [1, 2, 3, 4] pairs = map(lambda n: (n, 2*n), numbers) print(pairs) for pair in pairs: print(pair)
<map object at 0x7fcd264a15f8> (1, 2) (2, 4) (3, 6) (4, 8)
numbers = [1, 2, 3, 4] pairs = map(lambda n: (n, 2*n), numbers) print(pairs) for pair in pairs: print(pair)
<map object at 0x7fcd264a15f8> (1, 2) (2, 4) (3, 6) (4, 8)