Skip to content

Instantly share code, notes, and snippets.

@todbot
Last active November 30, 2020 00:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todbot/3b94af3fa4a177ff9ae6c7b4bc912afe to your computer and use it in GitHub Desktop.
Save todbot/3b94af3fa4a177ff9ae6c7b4bc912afe to your computer and use it in GitHub Desktop.
xmasbag = pick 15 days of December for each of us # Tod & Carlyn 2020
#!/usr/bin/env python3
# Pick 15 days of December for each of us
# Tod & Carlyn 2020
# alternate (better) version here: https://gist.github.com/carlynorama/a63b66157c2f2963c9ff9bbe657cfcee
#
import random
days = [d+1 for d in range(30)]
print("days:", days)
carlyn_days = random.sample(days, k=15)
tod_days = [d for d in days if (d not in carlyn_days)]
carlyn_days.sort()
tod_days.sort()
print(len(carlyn_days), "carlyn_days:",carlyn_days)
print(len(tod_days), "tod_days:",tod_days)
# official output is:
# 15 carlyn_days: [2, 3, 5, 8, 10, 14, 15, 16, 17, 20, 24, 25, 27, 28, 30]
# 15 tod_days: [1, 4, 6, 7, 9, 11, 12, 13, 18, 19, 21, 22, 23, 26, 29]
@todbot
Copy link
Author

todbot commented Nov 30, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment