Skip to main content
100%

Wichtel-Programm für die Familienweihnachtsfeier

✓ Published0🌍 Public
PP3nny
Last edited Dec 21, 2015
Created on Dec 21, 2015

This example visualizes a secret-Santa assignment algorithm for a family Christmas party, showing how each child is paired with a gift recipient while avoiding self-gifts and sibling pairs. The code uses Python’s `random.choice` to select potential recipients and manually checks constraints, appending a child back to the candidate list if a pairing is invalid, with a dictionary `wichteldict` storing final assignments. It also prints diagnostics, such as duplicate recipient checks, to verify the result. The source data is a hardcoded `familiendict` mapping parent names to their child lists.

AI-generated description

Similar vizzes