Answers for "sort two lists python"

2

sort two lists by one python

list1 = [3,2,4,1,1]
list2 = ['three', 'two', 'four', 'one', 'one2']
list1, list2 = zip(*sorted(zip(list1, list2)))
Posted by: Guest on October-15-2020
0

sort two lists that refence each other

>>> list1 = [3,2,4,1, 1]
>>> list2 = ['three', 'two', 'four', 'one', 'one2']
>>> list1, list2 = zip(*sorted(zip(list1, list2)))
>>> list1
(1, 1, 2, 3, 4)
>>> list2 
('one', 'one2', 'two', 'three', 'four')
Posted by: Guest on November-30-2020
0

merge sort of two list in python

a=[2,4,1,4]
b=[0,2,3,4]
a.extend(b)
a.sort()
print(a)
Posted by: Guest on September-13-2021

Code answers related to "sort two lists python"

Python Answers by Framework

Browse Popular Code Answers by Language