你题目的解答代码如下:
n = int(input("请输入一个月份:")) if n in [1,3,5,7,8,10,12]: print(31) else: if n == 2: print(28) else: print(30)
如有帮助,望采纳!谢谢!