Skip to content

Instantly share code, notes, and snippets.

@todbot

todbot/xmasbag.py

Last active Nov 30, 2020
Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@todbot todbot commented Nov 30, 2020

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