map(function, sequence)
Given a function and a sequence, constructs a sequence of the results of applying the function to the elements of the sequence.
functionfunction to apply to the elements
sequencesequence to map
list(map(abs, [-1, 2, -3]))[1, 2, 3]
list(map(lambda n: n * 2, [1, 2, 3]))[2, 4, 6]
See also map in the official documentation

PyTamaro is a project created by the Lugano Computing Education Research Lab at the Software Institute of USI
Privacy Policy • Platform Version 51af85f (Tue, 18 Nov 2025 10:59:34 GMT)