Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am getting a variable not defined error for pie _ 1 , although I have already defined it . The error is on line
I am getting a variable not defined error for pie although I have already defined it The error is on line Here is my code.
def getpies:
getpie
getpie
getpie
def getpie:
pie strinputWhat is the first pie type that guests can choose from?:
return pie
def getpie:
pie strinputWhat is the second pie type that guests can choose from?:
return pie
def getpie:
pie strinputWhat is the last pie type that guests can choose from?:
return pie
def checkvotespienumvotes:
result True
if intpienumvotes intguests:
result True
else:
result False
return result
def updatepiepienumvotes, pienum:
while checkvotespienumvotes False:
printThe amount of votes for each pie may not exceed the total number of guests"
pienumvotes intinputHow many people vote for pienum :
def getvotes:
printThere can only be one vote per person!"
pievotes intinputHow many people vote for strpie:
updatepiepievotes, pie
pievotes intinputHow many people vote for strpie:
updatepiepievotes, pie
pievotes intinputHow many people vote for strpie:
updatepiepievotes, pie
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