List of Lists to List of Tuples
Write a program to convert the list of lists to a list of tuples.
Sample Input1
3
1 2 3 4
10 20 30
5 10 15 20
Sample Output 1
[(1,2,3,4), (10,20,30), (5,10,15,20)]
lst = [[1, 2,3,4], [10, 20,30], [5, 10,15,20]]
tuples = [tuple(x) for x in lst]
print(tuples)
Comments
Leave a comment