Year = int(input('请输入年份: '))
Month = int(input('请输入月份: '))
#31天的情况判断
if (Month == 1 or Month == 3 or Month ==5 or Month == 7 or Month == 8
or Month == 10 or Month == 12):
print('本月31天')
#30天的情况判断
elif (Month == 4 or Month == 6 or Month ==9 or Month == 11):
print('本月30天')
#闰年2月判断
elif Month ==2 and ((Year % 4 == 0 and Year % 100 !=0 ) or Year % 400 == 0):
print('本月29天')
#28天情况判断
else:
print('本月28天')
原创文章,作者:,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/275167.html