Skip to content

Instantly share code, notes, and snippets.

@gkocjan

gkocjan/gifts.py

Created Nov 7, 2019
Embed
What would you like to do?
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
You can’t perform that action at this time.