Created
November 27, 2020 16:29
-
-
Save geoangelotti/d39997394280623ba32405f282772f9c to your computer and use it in GitHub Desktop.
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
#!/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