Python Program to Check Leap Year

Python Program to Check Leap Year

How can we check Leap Year in Python? Leap year is that year which has 366 days, and the extra day is in the month of February (29th)

Leap year in Python :



year = int(input("Please Enter the Year Number you wish : "))

if (year%400 == 0):
          print("%d is a Leap Year" %year)
elif (year%100 == 0):
          print("%d is a the Leap Year" %year)
elif (year%4 == 0):
          print("%d is a Leap Year" %year)
else:
          print("%d is Not a Leap Year" %year)
         

Output :