Decode School

Free Certification Courses from

Leap year in python

Python Program to get a year and check whether year is leap year or not.

Sample Input 1:


Sample Output 1:

Leap year

Sample Input 2:


Sample Output  2:

Not Leap Year

Program or Solution


Program Explanation

Get input year from user using input() method check whether the remainder of year divided by 4 is equal to 0 using if statement.

if it is 0, then print year is leap year using print() method.

Else print year is not leap year using print() method.