Articles → Python → Convert A List To A Tuple Using The Tuple Function In Python
Convert A List To A Tuple Using The Tuple Function In Python
Example
list = [10,5,7,22,11,17]
print (list)
list = tuple(list)
print(list)
- We have created a list of numbers
- Print the list
- Convert the list to a tuple
- Print the tuple
Output