用if函数
year = int(input("请输入年份:"))
if year % 4 == 0 and year%100!=0:
print(year, "是普通闰年" )
elif year % 400 == 0:
print(year, "是世纪润年")
else:
print(year, "是不是闰年")
结果
2002
2020
2023-12-27 11:01:57
用if函数
year = int(input("请输入年份:"))
if year % 4 == 0 and year%100!=0:
print(year, "是普通闰年" )
elif year % 400 == 0:
print(year, "是世纪润年")
else:
print(year, "是不是闰年")
结果
2002
2020