if (year % 4) == 0:
if (year % 100) == 0:
if (year % 400) == 0:
print(year,”is a leap year”)
else:
print(year,”is not a leap year”)
else:
print(year,”is a leap year”)
else:
print(year,”is not a leap year”)
from datetime import date
y = int(input(“enter a year”))
if y % 4 == 0:
if y % 100 == 0:
if y % 400 == 0:
print(“leap year”)
else:
print(“not a leap year”)
else:
print(“leap year”)
else:
print(“not a leap year”)
year=int(input(“Enter year to be checked:”))
if(year%4==0 and year%100!=0 or year%400==0):
print(“The year is a leap year!”)
else:
print(“The year isn’t a leap year!”)
def is_leap(year):
Tomy is a contributor at AskMeCode. We are committed to providing well-researched, accurate, and valuable content to our readers.
You May Also Like
How to get started with Python
I've been having a blast learning Python so far. It was pretty easy to learn, has a wide range of...
What is a Leap Year Program in C? a blog explaining what a leap year program is and how it can be used to get a full day’s worth of calculations.
The Leap Year Program in C is a blog explaining what a leap year program is and how it can...
5 Programming Languages for Beginners
5 Programming Languages for Beginners: A blog about some of the easiest programming languages but first you have to know...
prism.js | Ajax for the Rest of Us
Ajax has been around for a long time now. I remember using it way back in 2004 when I was...
