Created
November 10, 2014 03:04
-
-
Save chipbell4/4fe541a3b651d53cc342 to your computer and use it in GitHub Desktop.
My Funday Solution
This file contains hidden or 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 | |
| N = int(input().strip()) | |
| for i in range(N): | |
| # read in the date | |
| current_date = datetime.datetime.strptime(input().strip(), '%B %d, %Y') | |
| # diff with our reference point | |
| delta = current_date - datetime.datetime(2000, 1, 1) | |
| # how many days (mod 8 of course, lol) | |
| day_index = delta.days % 8 | |
| # pick out the day of the week (0 is Saturday) | |
| day_names = ['Saturday', 'Sunday', 'Funday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'] | |
| print(day_names[day_index]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment