sort one list based on values in another list code example
Example: sort a list by values of another one python
numbers = [1, 2, 3]
letters = ['c', 'a', 'b']
#The numbers array sorted by the letters order
sorted_list = [number for letter, number in sorted(zip(letters, numbers))]
print(sorted_list)
#prints: [2, 3, 1]