Last active
November 29, 2017 19:03
-
-
Save bazbt3/abf7616024e35383f8e003531f33efd6 to your computer and use it in GitHub Desktop.
Secret Santa gift chooser
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
# Secret Santa gift chooser | |
# @bazbt3 | |
import random | |
items = ["suits", "flange", "nipple", "socket", "lubricant", "gusset", "spigot", "Cairo!"] | |
print("initial list\n", items) | |
i = 0 | |
for item in items: | |
i += 1 | |
while i != 0: | |
j = i | |
while j != 0: | |
random.shuffle(items) | |
print("shuffled list\n", items) | |
n = random.randrange(i) | |
if i > 1: | |
print("Remove", items[n], "from list.") | |
elif i == 1: | |
print("Only", items[n], "remains. Get it!!!") | |
del items[(n)] | |
j -= 1 | |
i -= 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment