Leap Year or Not - Learn Engineering

All the news and updates relevant to Engineering. You can also Write a post here

Breaking

Friday, June 19, 2020

Leap Year or Not

python-mini

Question

To Find whether the given year is a leap year or not.

Sample TestCaseExpected Output

Enter the Year: 2020                                                                                          Leap Year




Answer


year=int(input("Enter the Year : "))
if(year%4==0 and year%100!=0 or year%400==0):
    print("Leap Year")
else:
    print("Not a Leap Year")

No comments:

Post a Comment