Skip to content

Instantly share code, notes, and snippets.

@gkocjan
gkocjan / secret_santa.py
Created November 8, 2019 12:13
Simple secret santa without ifs and fors
import random
def match_persons(persons):
givers = persons.copy()
random.shuffle(givers)
recipients = givers[1:] + [givers[0]]
return zip(givers, recipients)
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