Question: Task Description Background In this task, you will use Python to create a program that creates an order for Thanksgiving pies based on the number
Task Description
Background
In this task, you will use Python to create a program that creates an order for Thanksgiving pies
based on the number of people attending Thanksgiving dinner and how many votes each pie type
receives. You must demonstrate your skills by incorporating functions, loops, conditional
statements, and string manipulations.
Your Task
In part you will complete the following tasks:
Ask for the number of pcople coming to Thanksgiving dinner
Ask for three different pie options guests can choose from
Ask for the number of votes for each ple type
a Create the following functions to do this
An updatepie function will continually ask the user for the number of votes for
A checkwotes function will be used to check that the number of votes glven is
acceptable based on the number of people attending dinner
Update the number of votes for eoch pie type as well as the number of total votes from guasts
In part you will complete the following tasks:
Print out how many people voted
If there are any unused votes, let the user know how many additional votes there were
and that they will be added to the first ple choice
Print the final order for each pie type
A pieorder function will be used to return the number of ples to be ordered of each type
If less than people voted for a pie type, there will be pies of that type ordered
For every people that voted for a ple type, an additional ple will be ordered For
example: I people woted for pumpkin, pie will be ordered. If people voted for
a pie, will be ondered.
# Ask user for number of votes for pietype
# Use the checkvotes function to make sure the vote count is viable
# If the vote count is not viable, ask again
# Otherwise, return the number of votes for that pie type
#
# Parameters:
# numpievotes int: The number of votes for this pie type that a user has entered
# pietype str: Text containing the name of the pie type
#
# Return value int: The accepted number of votes for that pie type
#def updatepienumpievotes, pietype:
# If the number of votes for this pie type is higher than number of people,
# or if the number of total votes is higher than number of people, False is returned
# If not, True is returned
#
# Parameters:
# votes: The number of votes for this pie type that a user has entered
#
# Return value bool: A boolean value accepting or denying the number of votes
#def checkvotesvotes:
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
