输入月份输出英语单词Python代码
时间: 2024-03-25 17:38:25 浏览: 87
背英语单词python小程序(源码文件+单词和汉译文本文件)
当然可以,以下是 Python 代码实现:
```python
month_num = int(input("请输入月份:"))
if month_num == 1:
print("January")
elif month_num == 2:
print("February")
elif month_num == 3:
print("March")
elif month_num == 4:
print("April")
elif month_num == 5:
print("May")
elif month_num == 6:
print("June")
elif month_num == 7:
print("July")
elif month_num == 8:
print("August")
elif month_num == 9:
print("September")
elif month_num == 10:
print("October")
elif month_num == 11:
print("November")
elif month_num == 12:
print("December")
else:
print("输入错误,请输入1-12之间的整数。")
```
希望这可以帮到你。
阅读全文