xmasbag = pick 15 days of December for each of us # Tod & Carlyn 2020
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
#!/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] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alternate (better) version here: https://gist.github.com/carlynorama/a63b66157c2f2963c9ff9bbe657cfcee