Jul-29-2022, 09:12 PM
I don't know what you want to do, but months are always sorted
monthdays = {'Jan':31, 'Feb':28, 'Mar':31, 'Apr':30, 'May':31, 'Jun':30, 'Jul':31, 'Aug':31, 'Sep':30, 'Oct':31, 'Nov':30, 'Dec':31} for month in monthdays: print(f"There are {monthdays[month]} days in {month}")
Output:There are 31 days in Jan
There are 28 days in Feb
There are 31 days in Mar
There are 30 days in Apr
There are 31 days in May
There are 30 days in Jun
There are 31 days in Jul
There are 31 days in Aug
There are 30 days in Sep
There are 31 days in Oct
There are 30 days in Nov
There are 31 days in Dec