Skip to content

Instantly share code, notes, and snippets.

@chipbell4
Created November 10, 2014 03:04
Show Gist options
  • Select an option

  • Save chipbell4/4fe541a3b651d53cc342 to your computer and use it in GitHub Desktop.

Select an option

Save chipbell4/4fe541a3b651d53cc342 to your computer and use it in GitHub Desktop.
My Funday Solution
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