Created
October 23, 2020 11:51
-
-
Save AnnikaNoren/155cf785a920fa9fd25fa886f761ea51 to your computer and use it in GitHub Desktop.
strptime.py
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
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