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

Basic Calculator with if elif Using Python

وزارت قانون و انصاف حکومت پاکستان میں شاندار نوکریاں

Describe in the light of Paget’s theory the cognitive and intellectual development of a child at different levels.

Why Google stopped showing the card of summary of your site's performance on Google Search ?

Schedule of assessment for the post of Enforcement officer and Investigation officer 2025

Input a list and create a dictionary where keys are elements and values are their frequency using Python

Government Announced Minimum Wages For Every Private and Government Employees. New Notification

Kazakhstan Government Scholarship - How to Apply ? - Complete Detail

Air University Main Campus - How to Apply

10-Day PhD Interview Prep Series: Essential Questions & Answers