Skip to content

Instantly share code, notes, and snippets.

@geoangelotti
Created November 27, 2020 16:29
Show Gist options
  • Save geoangelotti/d39997394280623ba32405f282772f9c to your computer and use it in GitHub Desktop.
Save geoangelotti/d39997394280623ba32405f282772f9c to your computer and use it in GitHub Desktop.
#!/bin/env python
import sys
import random
f = open(sys.argv[1], "r")
people = f.readlines()
people = list(map(lambda person: person.replace('\n', ''), people))
identifiers = list(range(len(people)))
random.shuffle(identifiers)
gift_to = identifiers[1:] + identifiers[:1]
for i in range(len(people)):
print(f'{people[i]} is number {identifiers[i]}, and buys gift to {gift_to[i]}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment