print('%d年是闰年' % year)
isRunNian = True
else:
print('%d不是闰年' % year)
isRunNian = False
# 判断是否是闰年...if isRunNian:
# 判断月
if month in [x for x in range(1, 13)]:
monthmaxd = [0, 31, 29, 31..., 30, 31, 30, 31, 31, 30, 31, 30, 31]
# 判断日
if day <= monthmaxd[month]:
print...有效日期')
else:
print('不是有效日期,日错误')
else:
print('不是有效日期,月错误')
else:
# 判断月...in range(1, 13)]:
monthmaxd = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
# 判断日