Question: Assign values to variables as indicated below. Use standard Python naming conventions, as discussed in class. list of names of people to win a prize
Assign values to variables as indicated below. Use standard Python naming conventions, as discussed in
class.
list of names of people to win a prize or list of ticket numbers to win a prize
list of kinds of prizes
list of corresponding numbers of each kind of prize
Assign the list of winners to be the empty list.
Print the participants. Use a for loop to create clear formatting for the output. If you use names, ensure that
the message prints each name in title case, so that even if the variable value for the name is "chris
lagUerre", the name will print as Chris Laguerre.
Print the number of prizes available in each category. Use an fstring. Use for a for loop to create clear
formatting for the output.
Draw a person's name or ticket number at random from the list. Use the random library.
Pop the winner from the list of participants. Append the winner to the winners list.
Select one of the kinds of prizes at random from the list. Use the random library.
Print a message indicating who the winner is and that they are entitled to one of whatever number of prizes
is available in that category. Use an fstring. If you use names, ensure that the message prints each name in
title case.
Reduce the number of prizes available in that category by
Print the winners so far. Use a for loop to create clear formatting for the output. If you use names, ensure
that the message prints each name in title case.
Repeat the prizedrawing process inside a for loop. The number of prizes that you award to winners is up
to you the number of times you execute the for loop is up to you Ensure that you have more people
eligible for the drawing initially than the number of prizes you will draw, so that you don't run out of
participants while executing the for loop. Ensure that you have have enough of each type of prize that you
will not run out of prizes while executing the for loop.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
