3. Check Leap year

Acceptance 100% 1 accepted 1 submissions

Easy
No topics listed
No companies listed
3 Leap Year Check Write a Python program that asks the user to enter a year. Then check if the given year is a leap year or not. A year is a leap year if it is divisible by 4 but not divisible by 100, OR if it is divisible by 400. If the year is a leap year, print "Leap year". If not, print "Not a leap year". The program must take the year as input from the user. Easy

Example 1

Input
2000
Output
Leap year

Explanation 2000 is divisible by 400 so it is a Leap year

Example 2

Input
1900
Output
Not a leap year

Explanation 1900 is divisible by 100 but not by 400 so it is Not a leap year

Example 3

Input
2024
Output
Leap year

Explanation 2024 is divisible by 4 and not divisible by 100 so it is a Leap year

Acceptance 100%
Accepted 1
Submissions 1
Auto-save
Saved Ln 1, Col 1
Submit a solution to see its status here.
Input
Expected Output
Leap year
No results yet
Run your code to test it against the sample cases.
Problem List