Novice here, Question, why do I need to subtract one to reference the correct indice for month_name and ordinal.
This prints out a date, given year, month, and day as numbers from inputs.
months = ['January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October', 'November', 'December']
endings = ['st', 'nd', 'rd'] + 17 * ['th'] \
+ ['st', 'nd', 'rd'] + 7 * ['th'] \
+ ['st']
year = input('Year: ')
month = input('Month (1-12: ')
day = input('Day (1-31): ')
month_number = int(month)
day_number = int(day)
month_name = months[month_number-1] #Although it works, what's the logic.
ordinal = day + endings[day_number-1 #Although it works, what's the logic.
print(month_name , ' ' + ordinal , ', ' + year)