You can convert a list into a tuple simply by passing to the tuple function.
Example
my_list = [1, 2, 3] my_tuple = tuple(my_list) print(my_tuple)
Output
This will give the output −
(1, 2, 3)
You can convert a list into a tuple simply by passing to the tuple function.
my_list = [1, 2, 3] my_tuple = tuple(my_list) print(my_tuple)
This will give the output −
(1, 2, 3)