Skip to content

Instantly share code, notes, and snippets.

gkocjan /
Created November 8, 2019 12:13
Simple secret santa without ifs and fors
import random
def match_persons(persons):
givers = persons.copy()
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 = [
for recipient in recipients
if recipient != person