Created
March 4, 2021 11:53
-
-
Save jishnujayakumar/b52a3ccb5425839d21dff28d6e3e98ce to your computer and use it in GitHub Desktop.
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 < 1918: | |
return year%4 == 0 | |
elif year > 1918: | |
return (year%400==0) or ((year%4==0) and (year%100 != 0)) | |
def day_of_programmer(year): | |
if year == 1918: | |
return f"26.09.{year}" | |
else: | |
if is_leap_year(year): | |
return f"12.09.{year}" | |
else: | |
return f"13.09.{year}" | |
# Test | |
print(day_of_programmer(2100)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment