How to Convert Tuple to List in Python

We know that Lists are mutable objects while tuples are immutable. There is a built-in Python list method list() that can be used for converting Tuples to Lists. This method list() takes sequence types and converts them to lists.
Tuples are very similar to lists with the only difference that element values of a tuple can not be changed and tuple elements are put between parentheses instead of square bracket.
Example:
color = ("red", "green", "blue") print(color) print(type(color)) color_list = list(color) print(color_list) print(type(color_list))
Output:
('red', 'green', 'blue') <class 'tuple'> ['red', 'green', 'blue'] <class 'list'>
Subscribe
Login
Please login to comment
0 Discussion