Answer to Question #256676 in Python for Raju

Question #256676

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)]


1
Expert's answer
2021-10-27T00:25:29-0400
lst = [[1, 2,3,4], [10, 20,30], [5, 10,15,20]]
tuples = [tuple(x) for x in lst]
print(tuples)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS