My code surrounding the while loop is, for the most part, working fine. However the while loop won't stop repeating even if the user inputs 5 which should make it exit. This now includes all code relevant to the function I am trying to debug, I apologize for any confusion:
def dinos():
welcomeTheCustomer()
selection = "\0"
while selection != "4":
selection = requestUserInput()
if selection is "1":
order()
elif selection is "2":
checkOut()
elif selection is "3":
startOver()
print("Have a good day!")
def askUserToChooseADonut():
print("\n -MENU-\n 1.Strawberry Twizzler\n 2.Chocolate-dipped Maple Puff\n 3.Vanilla Chai Strudel\n 4.Honey-Drizzled Lemon Dutchie\n 5.Done\n")
donutChoice = int(raw_input("Please enter a selection: "))
return(donutChoice)
def askUserToSpecifyDonutQuantity():
donutQuantity = "d"
while not donutQuantity.isdigit():
donutQuantity = str(raw_input("Please enter a quantity of donuts: "))
return int(donutQuantity)
print ("Confirmed")
def order():
donutChoice = 0
donutQuantity1 = 0
donutQuantity2 = 0
donutQuantity3 = 0
donutQuantity4 = 0
while not (donutChoice == 5): # loop until the customer selects '5. Done'
donutChoice = int(askUserToChooseADonut())
donutQuantity = askUserToSpecifyDonutQuantity()
if donutChoice is 1:
donutQuantity1 = donutQuantity
elif donutChoice is 2:
donutQuantity2 = donutQuantity
elif donutChoice is 3:
donutQuantity3 = donutQuantity
elif donutChoice is 4:
donutQuantity4 = donutQuantity
return (donutQuantity1, donutQuantity2, donutQuantity3, donutQuantity4)