Created
March 19, 2024 16:12
-
-
Save MahraibFatima/b937c8daf5d6021ab466310ff0526e6c to your computer and use it in GitHub Desktop.
Determine whether the entered year is a leap year or not .
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: ")) | |
if is_leap_year(year): | |
print("Leap year") | |
else: | |
print("Not a leap year") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment