List to tuple example
Input
[1, 2, 3]
Output
(1, 2, 3)
A list [1,2,3] should be converted into a tuple (1,2,3).
Full lesson preview
Learn to convert a list to a tuple and a tuple to a list. Useful when APIs require a specific sequence type.
Problem statement
Task
Examples
Input
[1, 2, 3]
Output
(1, 2, 3)
A list [1,2,3] should be converted into a tuple (1,2,3).
Input format
Output format
Constraints
Samples
Input
[1, 2]
Output
(1, 2)
Converts list to tuple.