Skip to content

Instantly share code, notes, and snippets.

@gkocjan
Created November 7, 2019 14:28
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 gkocjan/634d7e17895b982c4176f506af7adadd to your computer and use it in GitHub Desktop.
Save gkocjan/634d7e17895b982c4176f506af7adadd to your computer and use it in GitHub Desktop.
import random
givers = ['Marek', 'Przemek', 'Michał', 'Kamila']
recipients = givers.copy()
for person in givers:
potential_gift_recipient = [
recipient
for recipient in recipients
if recipient != person
]
recipient = random.choice(potential_gift_recipient)
recipients.remove(recipient)
print(f"{person} buys gift for {recipient}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment