I have a list that is filled with HTML elements. I also have a list filled with date/times, which is parallel to the HTML list.
How can I sort the HTML list based on the
You can use a third-party package called more_itertools:
import more_itertools
timestamps = ["08-11-17", "01-13-17", "11-22-17"]
elements = ["", "", ""]
more_itertools.sort_together([timestamps, elements])
# [('01-13-17', '08-11-17', '11-22-17'), ('', '', '')]
See more_itertools docs for more information.