Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dnozay
Created November 18, 2016 20:47
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 dnozay/decd7469820b2950583d627e18f63319 to your computer and use it in GitHub Desktop.
Save dnozay/decd7469820b2950583d627e18f63319 to your computer and use it in GitHub Desktop.
quick tool for making a christmas gifting list.
#!/usr/bin/python
# e.g. python gift-shuffle.py linda dad adam misty laura damien bryan joelle
# dad == gives present to ==> damien
# damien == gives present to ==> joelle
# joelle == gives present to ==> linda
# linda == gives present to ==> adam
# adam == gives present to ==> laura
# laura == gives present to ==> bryan
# bryan == gives present to ==> misty
# misty == gives present to ==> dad
import sys
import random
people = sys.argv[1:]
if len(people) < 2:
raise RuntimeError('not enough people for gift shuffle')
random.shuffle(people)
for santa, person in zip([people[-1]]+people[:-1], people):
print '{0:^15} == gives present to ==> {1:^15}'.format(santa, person)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment