Program to check for a Leap Year




#Program to check for a Leap Year 

x=int(input("Enter the year "))

if x%100==0:

    if x%400==0: 

#if the year is divisible by 100 and not divisible by 400, the year is skipped

        print("Leap year")

    else:

        print("Not a leap year")

         

elif x%4==0:

    print("Leap year")

else:

    print("Not a leap year")










Comments

Popular Posts