Skip to content

Instantly share code, notes, and snippets.

@jishnujayakumar
Created March 4, 2021 11:53
Show Gist options
  • Save jishnujayakumar/b52a3ccb5425839d21dff28d6e3e98ce to your computer and use it in GitHub Desktop.
Save jishnujayakumar/b52a3ccb5425839d21dff28d6e3e98ce to your computer and use it in GitHub Desktop.
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