Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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)))
 
PREVIOUS NEXT
Tagged: #sort #lists #python
ADD COMMENT
Topic
Name
9+5 =