merge and sort 2 lists python code example
Example 1: 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)))
Example 2: merge two lists
# Makes list1 longer by appending the elements of list2 at the end.
list1.extend(list2)