how to convert tuple into list in python

Solutions on MaxInterview for how to convert tuple into list in python by the best coders in the world

showing results for - "how to convert tuple into list in python"
Benjamin
26 Mar 2019
1tuple1 = ("car", "bike", "bus")
2list1= list(tuple1)
3print(list1)
Daniel
23 Nov 2018
1# Python3 code to demonstrate 
2# convert list of tuples to list of list 
3# using list comprehension 
4  
5# initializing list  
6test_list = [(1, 2), (3, 4), (5, 6)] 
7  
8# printing original list  
9print("The original list of tuples : " + str(test_list)) 
10  
11# using list comprehension 
12# convert list of tuples to list of list 
13res = [list(ele) for ele in test_list] 
14  
15# print result 
16print("The converted list of list : " + str(res))