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
A Guide to Google Cloud Platform (GCP)Prisma Coding Competition
The Google Cloud Platform team is introducing a coding competition where you can win prizes and swag by creating Android...
Debugging for Small Spaces
Debugging for Small Spaces: Solving Sustainability Challenges with Problem-Solving Skills Welcome to the world of debugging—not just for code, but...
Coding Tutorials for Beginners: Getting Started
The Eco-Warrior's Code: Sustainable Coding Practices for Green Living Enthusiasts In an age where technology shapes our daily lives, coding...
Smart Decorators Use Three When Creating Code
Walking down the halls of our office, you will hear a lot of conversations about code. We are a team...
