userInput = int(input("input the year"))
if userInput % 4 == 0:
if userInput % 400 == 0:
print("leap year")
elif userInput % 100 == 0:
print("not leap year")
else:
print("leap year")
else:
print("not leap year")
闰年判断规则:
能被4整除但不能被100整除;
能被400整除