Decode School

Decode School - The School for Problem Solvers

Welcome to my blog. Subscribe and get my latest blog post in your inbox.

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.