In this Python tutorial, you will learn how to convert a tuple object into a list object using list() builtin function.
Python Convert Tuple into List
To convert a tuple into list in Python, call list() builtin function and pass the tuple as argument to the function. list() returns a new list generated from the items of the given tuple.
Python list() builtin function
We will go through some examples, where we demonstrate how to convert tuple to list in Python.
Examples
1 Convert Tuple to List
In the following example, we initialize a tuple and convert it to list using list(sequence).
Python Program
#initialize tuple aTuple = (True, 28, 'Tiger') #tuple to list aList = list(aTuple) #print list print(type(aList)) print(aList)
Output
<class 'list'> [True, 28, 'Tiger']
Reference tutorials for the above program
2 Convert Tuple of Integers to List
In the following example, we initialize a tuple with all integers and convert it to a list using list(sequence).
Python Program
#initialize tuple aTuple = (67, 28, 41, 37) #tuple to list aList = list(aTuple) #print list print(type(aList)) print(aList)
Output
<class 'list'> [67, 28, 41, 37]
Conclusion
In this Python Tutorial, we learned how to convert a tuple into list in Python using list(sequence), with the help of example Python programs.