Python program to check leap year

yr = int(input("Insert any year to check for leap year: "))
if yr%4 == 0:
 print("This is a leap year!")
else:
 print("This is not a leap year!")

 

 

 

Output:

Insert any year to check for leap year: 2020
This is a leap year!

 

Insert any year to check for leap year: 2022
This is not a leap year!

Subscribe For Daily Updates