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
Zip the two lists up into tuples, sort, then take the HTML back out of the tuple:
zipped = zip(timestamps, htmls) zipped.sort() sorted_htmls = [html for (timestamp, html) in zipped]