#!/usr/bin/env python3
def ifLeapOrNot(year):
if year % 400 == 0:
print("400")
return 1
elif year % 4 == 0:
if year % 100 == 0:
print("100")
return 0
else:
print("4")
return 1
else:
print("Not Leap")
return 0
ifLeapOrNot(2008)
ifLeapOrNot(2018)
ifLeapOrNot(2100)
ifLeapOrNot(2400)
Python:判断是否是闰年
猜你喜欢
转载自blog.csdn.net/xikangsoon/article/details/84823872
今日推荐
周排行