Last active
May 31, 2018 03:05
-
-
Save carlynorama/d2ffde339f6749d8cb09e7179a44a825 to your computer and use it in GitHub Desktop.
check if any date is a Tuesday
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 | |
import dateutil.parser #dateutil module | |
date = datetime.datetime.today() | |
def is_it_tuesday(date_to_check): | |
if date_to_check.weekday() == 1: | |
print("yes") | |
else: | |
print("no") | |
if __name__ == "__main__": | |
raw_date_string = input('What day do you want to check? ') | |
checkme = dateutil.parser.parse(raw_date_string) | |
is_it_tuesday(checkme) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment