Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
7550 views
ubuntu2004
1
month_names = [
2
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
3
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
4
]
5
6
def sort_by_month(month1, month2):
7
month1_index = month_names.index(month1)
8
month2_index = month_names.index(month2)
9
10
return cmp(month1_index, month2_index)
11