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.
function
function to apply to the elements
sequence
sequence 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 ede3c94 (Fri, 23 May 2025 14:43:18 GMT)