How to convert list of lists to tuple in Python

1 Answer

0 votes
lst = [[1,2], [3,4], [5,6]]

tpl = tuple(tuple(i) for i in lst)

print(tpl) 




'''
run:

((1, 2), (3, 4), (5, 6))

'''

 



answered Dec 15, 2023 by avibootz

Related questions

2 answers 230 views
2 answers 264 views
1 answer 133 views
1 answer 168 views
2 answers 245 views
1 answer 216 views
...