I have an ordered list and an unordered list, and I'm attempting to figure out how to sort the ordered_list's order based on the unordered_list's. I tried playing with indexes of each element in both lists but was unsuccessful. So, I'm guessing someone has had similar issues or can tell me what function I need to perform.
unordered_list = ['North_America', 'Europe', 'Asia', 'Antarctica', 'Australia', 'Africa']
ordered_list = ['Africa.jpg', 'Asia.jpg', 'Antarctica.jpg', 'Australia.jpg', 'Europe.jpg', 'North_America.jpg']
# I want to reorder the list in this manner for this case: [5,4,1,2,3,1]
The desired output:
ordered_list = ['North_America.jpg', 'Europe.jpg', 'Asia.jpg', 'Antarctica.jpg', 'Australia.jpg', 'Africa.jpg']