Skip to content

Instantly share code, notes, and snippets.

@AnnikaNoren
Created October 23, 2020 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AnnikaNoren/155cf785a920fa9fd25fa886f761ea51 to your computer and use it in GitHub Desktop.
Save AnnikaNoren/155cf785a920fa9fd25fa886f761ea51 to your computer and use it in GitHub Desktop.
strptime.py
import datetime
from datetime import datetime
import calendar
def has_friday_13(month, year):
date = f'{month} 13 {year}'.format()
spooky = datetime.strptime(date, '%m %d %Y').weekday()
return (calendar.day_name[spooky]) == "Friday"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment