How to sort lists in tuple of lists with Python

1 Answer

0 votes
tpl_lst = ([7, 3, 2], [3, 2, 1], [9, 4, 5], [6, 0, 1]) 
  
tpl_lst = tuple((sorted(sub) for sub in tpl_lst)) 

print(tpl_lst) 

 
 
'''
run:
 
([2, 3, 7], [1, 2, 3], [4, 5, 9], [0, 1, 6])
 
'''

 



answered Dec 19, 2019 by avibootz

Related questions

2 answers 399 views
2 answers 364 views
1 answer 255 views
1 answer 213 views
2 answers 365 views
...