Next time put your code between python tags using ctrl+shift+v or right mouse click>paste as plain text. You can get the python tags by clicking the little python logo from the tools from the post editor here.
This line -
If I change it with
Put the code in python tags to provide the indentation because the logic in the code is missing. I indented the code just to work and it works.
Do not pay atention on my choices. I don't even know what is all of this.
This line -
elif (UserChoice == 2) or (UserChoice == 3):
- after the BreadChoise checking comes after else statement. The order of this conditional statements is if>elif>else. Also, are you sure you have to check for UserChoise not for BreadChoice?If I change it with
if
, a MenuItem variable appears out of nothing. If a wrong item is chosen everywhere this variable is not defined at all but you want to print it. The same is for printing the messages for all of the choices before that - BreadChoice.Output:What would like from the menu??
1. Eggs
2. Pancakes
3. Waffles
4. Oatmeal
Please select a number between 1 and 4: 5
What bread would you like with your Eggs?
1. Wheat Toast
2. Sour Dough
3. Rye Toast
4. Pancakes
Please select your bread type1
Traceback (most recent call last):
File "untitled.py", line 40, in <module>
print (" You have selected Wheat Toast with your ", MenuItem)
NameError: name 'MenuItem' is not defined
At the bottom of the code, you have two else statements one after another. Put the code in python tags to provide the indentation because the logic in the code is missing. I indented the code just to work and it works.
Do not pay atention on my choices. I don't even know what is all of this.