python,求解程序中的问题
month=['January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December'
]
ending=['st','nd','rd']+17*['th']\
+['st','nd','rd']+7*['th']\
+['st']
year=raw_input('Year:')
month=raw_input('Month(1-12):')
day=raw_input('Day(1-31):')
month_number=int(month)
day_number=int(day)
month_name=months[month_number-1]
ordinal=day+ending[day_number-1]
print month_name+' '+ordinal+', '+year
请教month_name=months[month_number-1]这句代码哪里有问题
shell中显示 month_name=months[month_number-1]
NameError: name 'months' is not defined