Double integers
Input
(1, 2, 3), lambda x: x*2
Output
(2, 4, 6)
Each value is doubled via the provided lambda.
Full lesson preview
Apply a function to every element of a tuple using map and return a new tuple.
Problem statement
Task
Examples
Input
(1, 2, 3), lambda x: x*2
Output
(2, 4, 6)
Each value is doubled via the provided lambda.
Input format
Output format
Constraints
Samples
Input
('a', 'b'), lambda s: s.upper()
Output
('A', 'B')
The lambda converts each string to uppercase.