Skip to content

Instantly share code, notes, and snippets.

@phargogh
Created September 1, 2021 16:13
Show Gist options
  • Save phargogh/00165d92e08af379717de68551707f99 to your computer and use it in GitHub Desktop.
Save phargogh/00165d92e08af379717de68551707f99 to your computer and use it in GitHub Desktop.
NatCap software team office hours rotations for September, 2021 trial period
"""Randomly generate office hours rotations for the defined dates.
This was brought up as a possible way of randomly picking office hours
assignments during the original trial run of office hours in September, 2021.
"""
import random
# Group Wednesday-to-following-Monday
# This is because of the labor day holiday on Monday the 6th that offsets the
# whole calendar.
DAYS_AND_WEEKS = [
('9/08', '9/13'),
('9/15', '9/20'),
('9/22', '9/27'),
]
NAMES = ['Dave', 'Doug', 'Emily', 'James'] # Alphabetical
for (wednesday, monday) in DAYS_AND_WEEKS:
random.shuffle(NAMES) # side effect: shuffles NAMES
print(f"{wednesday}: {', '.join(NAMES[0:2])}")
print(f"{monday}: {', '.join(NAMES[2:])}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment