输入月份得到对应的单词

编写一个工具,输入月份能得到对应的单词(可以使用列表和索引)

def getMonthWord(month):
    l=['January','February','March','April','May','June','July','August','September','October','November','December']
    if month<1 or month>12:
        return 'Error'
    return l[month-1]

month=int(input('请输入月份:'))
print(getMonthWord(month))