求助 新学python 不知错那了?
#! /usr/bin/env python# list.sort()
months=[
'January=1'
'February=2'
'March=3'
'April=4'
'May=5'
'June=6'
'July=7'
'August=8'
'September=9'
'October=10'
'November=11'
'December=12'
]
endings=['st','nd','rd'] + 17*['th'] +['st','nd','rd'] +7 *['th']+['st']
#取得输入值
year=raw_input('year:')
month=raw_input('month:')
day=raw_input('day:')
#取得的值
month_number= int(month)
day_number=int(day)
month_name =months[month_number-1]
ordinal=day+endings[day_number-1]
print month_name +' '+ordinal+','+year
运行 总是提示:File "./news", line 28, in ?
month_name =months[month_number-1]
IndexError: list index out of range 请大侠给与指正 到底是哪错了?!