How to check Leap Year using python

def is_leap_year(year):if (year % 4 == 0 and year % 100 != 0) or (year % 400 ==

Created By :

Created On :

23-03-2024

How to check Leap Year using python

Updated on 24, February 2024 293 Enrolled
how to

Step 1

def is_leap_year(year):

if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):

return True return False

year = int(input("Enter a year: ")) i

f is_leap_year(year):

print("Leap year")

else:

print("Not a leap year")

line

Copyrights © 2024 letsupdateskills All rights reserved