def isLeapYear(year):
if year % 4 == 0 and year % 100 != 0 or year % 400 == 0:
print('{0}是闰年'.format(year))
return True
else:
print('{0}不是闰年'.format(year))
return False
year=eval(input('请输入年份:'))
isLeapYear(year)
python 闰年判断
最新推荐文章于 2023-09-23 15:34:08 发布