Leap Year or not

import calendar
def checkYear(year):
return(calendar.isleap(year))

year = int(input())
if (checkYear(year)):
print(“Leap Year”)
else:
print(“Not a Leap Year”)

2 Likes

Good, Keep it up, Practice with if else condition also.

def checkYear(year):
return (((year % 4 == 0) and (year % 100 != 0)) or (year % 400 == 0));
year = int(input())
if(checkYear(year)):
print(“Leap Year”)
else:
print(“Not a Leap Year”)

2 Likes

@shivaniposham97

Correct, keep it up.

1 Like