So if I have one list:
name = [\'Megan\', \'Harriet\', \'Henry\', \'Beth\', \'George\']
And I have another list where each value represents the
Consider a third-party tool more_itertools.sort_together:
Given
import more_itertools as mit
name = ["Megan", "Harriet", "Henry", "Beth", "George"]
score_list = [9, 6, 5, 6, 10]
Code
mit.sort_together([name, score_list])
# [('Beth', 'George', 'Harriet', 'Henry', 'Megan'), (6, 10, 6, 5, 9)]
Install more_itertools via > pip install more_itertools.