sort two lists that refence each other

Solutions on MaxInterview for sort two lists that refence each other by the best coders in the world

showing results for - "sort two lists that refence each other"
Lina
01 Jul 2020
1>>> list1 = [3,2,4,1, 1]
2>>> list2 = ['three', 'two', 'four', 'one', 'one2']
3>>> list1, list2 = zip(*sorted(zip(list1, list2)))
4>>> list1
5(1, 1, 2, 3, 4)
6>>> list2 
7('one', 'one2', 'two', 'three', 'four')
8