Since your dates are all in 2020, and the month figure before the day, and every month and day has exactly two digits, and the only difference between two filenames is the date: sorting the list of strings naively would produce the correct order.
In general though, to correctly parse a date, I recommend using datetime.datetime.strptime. You can supply it as the key argument to sorted or list.sort:
import datetime
allfiles = [
'/content/drive/MyDrive/COVID-19/csse_covid_19_data/csse_covid_19_daily_reports/11-07-2020.csv',
'/content/drive/MyDrive/COVID-19/csse_covid_19_data/csse_covid_19_daily_reports/11-12-2020.csv',
'/content/drive/MyDrive/COVID-19/csse_covid_19_data/csse_covid_19_daily_reports/07-28-2020.csv',
'/content/drive/MyDrive/COVID-19/csse_covid_19_data/csse_covid_19_daily_reports/03-16-2020.csv',
'/content/drive/MyDrive/COVID-19/csse_covid_19_data/csse_covid_19_daily_reports/07-18-2020.csv'
]
naively_sorted = sorted(allfiles)
sorted_by_date = sorted(allfiles,
key=lambda x: datetime.datetime.strptime(x[-14:-4], '%m-%d-%Y'))
print(naively_sorted)
print(sorted_by_date)
# ['/content/drive/MyDrive/COVID-19/csse_covid_19_data/csse_covid_19_daily_reports/03-16-2020.csv', '/content/drive/MyDrive/COVID-19/csse_covid_19_data/csse_covid_19_daily_reports/07-18-2020.csv', '/content/drive/MyDrive/COVID-19/csse_covid_19_data/csse_covid_19_daily_reports/07-28-2020.csv', '/content/drive/MyDrive/COVID-19/csse_covid_19_data/csse_covid_19_daily_reports/11-07-2020.csv', '/content/drive/MyDrive/COVID-19/csse_covid_19_data/csse_covid_19_daily_reports/11-12-2020.csv']
# ['/content/drive/MyDrive/COVID-19/csse_covid_19_data/csse_covid_19_daily_reports/03-16-2020.csv', '/content/drive/MyDrive/COVID-19/csse_covid_19_data/csse_covid_19_daily_reports/07-18-2020.csv', '/content/drive/MyDrive/COVID-19/csse_covid_19_data/csse_covid_19_daily_reports/07-28-2020.csv', '/content/drive/MyDrive/COVID-19/csse_covid_19_data/csse_covid_19_daily_reports/11-07-2020.csv', '/content/drive/MyDrive/COVID-19/csse_covid_19_data/csse_covid_19_daily_reports/11-12-2020.csv']
Note that the slice x[-14:-4] makes no assumption on what the beginning of the string looks like; but it does assume that the string ends with "mm-dd-yyyy.csv".
open()ed file handles, or something else?sort[ed]has thekey=keyword for exactly that sort of thing