Question
During the holiday season, people often exchange gifts. A popular game played when exchanging gifts is Secret Santa. In this game, participants enter in their
During the holiday season, people often exchange gifts. A popular game played when exchanging gifts is Secret Santa. In this game, participants enter in their names and each person is randomly assigned another participant to buy a gift for. Write a python program that allows the user to enter names of their friends until they enter x. The program should output random Secret Santa assignments. Make sure a person doesnt end up buying a gift for themselves.
Sample input: Enter name (x to generate assignments): Usman
Enter name (x to generate assignments): Wahid
Enter name (x to generate assignments): Zain
Enter name (x to generate assignments): Jagraj
Enter name (x to generate assignments): x
Sample output: Usman gifts Zain
Zain gifts Wahid
Wahid gifts Jagraj
Jagraj gifts Usman
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started