Skip to content

Instantly share code, notes, and snippets.

Created November 8, 2019 12:13
What would you like to do?
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)
def secret_santa():
for pair in match_persons(['Marek', 'Przemek', 'Michał', 'Kamila']):
print(f"Secret santa {pair[0]} buys gift for {pair[1]}")
if __name__ == "__main__":
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment