求助
要求根据数字1-12数字返回月份名称
monthstr = "一月二月三月四月五月六月七月八月九月十月十一月十二月"
monthid = eval(input("请输入月份数字(1-12):"))
if monthid in range(1,10):
pos = (monthid - 1) * 2
print(monthstr[pos:pos+2])
elif monthid in [11]:
pos = (monthid - 1) * 2
print(monthstr[pos:pos+3])
elif monthid in [12]:
pos = (monthid - 1) * 2
print(monthstr[pos+1:pos+4])
else:
print("请输入正确的数字")
请教一下更简洁的代码示例,感谢