Ask coding questions

← Back to all posts
leap year problem
rocky321 (0)

plz help

what wrong in code.iam getting wrong result

year = int(input("Which year do you want to check? "))

if year % 4 == 0:

print("leap year")

elif year % 100 == 1:

print(" leap year")

elif year % 400 == 0:

print("leap year")

else:

print("not leap year")
Comments
hotnewtop
ZarmDev (47)

Could you show the real code? I can't see any errors or the entire thing ()

rocky321 (0)

@ZarmDev

this is same code but when you enter 1700 to confirm is it leap year or not it ans leap year which is not correct