Discussions Events Study Material Jobs
Check Leap Year or Not Using Python - Uniwaly

Explore Diverse Conversations

Check Leap Year or Not Using Python

Posted By: UmairMehmood Published On: 13 June 2025 At: 13:22 PM

Input a year and check if it's a leap year.

Leap year rule: divisible by 4, not divisible by 100 unless also divisible by 400

year = int(input("Enter a year: "))

if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
    print(f"{year} is a Leap Year.")
else:
    print(f"{year} is NOT a Leap Year.")


Tags:

python leap year or not python code
Login to like

Posted By:

Author Profile

UmairMehmood

11 days ago

Join the conversation!

Login to Comment

Discover More Articles

Write a program to calculate the sum of all elements in a list using a for loop using Python

Al Barik Bank Jobs 2025 in Pakistan - Apply Now

Chief Minister Punjab Wildlife Internship Program 2025

Directorate of Electronic Media & Publications jobs in 2025 apply online

Communication & Coordination Officer - The Urban Unit Jobs 2025

Pension New Method Explained - Which Employees Not Eligible For Pension ?

Elucidate the role of public and private sector in elementary education. Discuss the role of government of Pakistan in this context.

Data Analyst Environment Protection and Climate Change Department Jobs 2025

Child Protection and Welfare Bureau Jobs 2025

Simple Number Guessing Game Using Python