mirror of
https://github.com/michivonah/python.git
synced 2025-12-22 20:46:29 +01:00
create wichtel tool
This commit is contained in:
parent
da17646165
commit
af13ce6289
1 changed files with 24 additions and 0 deletions
24
christmas/wichteln.py
Normal file
24
christmas/wichteln.py
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
# Christmas "wichteln" random people picker
|
||||||
|
# Michi von Ah
|
||||||
|
|
||||||
|
import random
|
||||||
|
|
||||||
|
names = ["sepp", "max", "hans", "maria"]
|
||||||
|
avail = names.copy()
|
||||||
|
picked = []
|
||||||
|
|
||||||
|
|
||||||
|
for person in names:
|
||||||
|
selection = random.choice(avail)
|
||||||
|
|
||||||
|
while selection == person:
|
||||||
|
selection = random.choice(avail)
|
||||||
|
avail.remove(selection)
|
||||||
|
print(f'{person} wichtelt {selection}')
|
||||||
|
|
||||||
|
|
||||||
|
# Example output:
|
||||||
|
# sepp wichtelt an hans
|
||||||
|
# max wichtelt an maria
|
||||||
|
# hans wichtelt an max
|
||||||
|
# maria wichtelt an sepp
|
||||||
Loading…
Add table
Add a link
Reference in a new issue