if you do not want the else to execute change all other if's except first to elif. the else only works with last if.
print("Good morning! What would you like for breakfast? \nYou can have eggs, cereal, fruit or pancakes.") breakfast = input("Please enter your choice of breakfast from the list: ") if breakfast == "eggs": print("How would you like your eggs? \nYou can have them fried, scrambaled, or boiled.") eggstype = input ("Please enter your choice of eggs from the list: ") if eggstype == "boiled": print("How would you like your eggs boiled? \nYou can have them hard or soft.") boiledtype=input("Please enter hard or soft: ") if boiledtype == "hard": print ("Thank you! Your hard boiled eggs will arrive soon.") if boiledtype == "soft": print ("Thank you! Your soft boiled eggs will arrive soon.") else: print("Sorry your choice is not available.") elif breakfast=="cereal": print("What gype of cereal would you like? \nYou may choose porridge, muesli, corn flakes or rice bubbles.") cerealtype = input("Pleaes enter your choice of cereals from the list: ") if cerealtype == "porridge": print("What type of milk you'd like with your cereal? \nYou may have full cream milk or light white milk.") milktype = input("Please enter full cream milk or light white milk:") if milktype == "full cream milk": print("Thank you and your porridge with full cream milk will arrive shortly.") if milktype == "light white milk": print("Thank you and your porridge with light white milk will arrive shortly.") else: print("Sorry your choice is not available.") elif breakfast=="fruit": print("What type of fruit would you like? \nYou may choose tropical or European fruit.") fruittype = input("Please enter your choice of fruit:") if fruittype == "tropical": print("What type of tropical fruit would you like? \nYou may choose duriam or pineapple.") tropicaltype = input("Please enter duriam or pineapple.") if tropicaltype == "duriam": print("Thank you and your duriam will arrive shortly.") if tropicaltype == "pineapple": print("Thank you and your pineapple will arrive shortly.") else: print("Sorry your choice is not available.") else: print("Sorry our auto system does not support this option yet \nPlease ask your waiter directly") print("Enjoy your breakfast")
Output:λ python play.py
Good morning! What would you like for
You can have eggs, cereal, fruit or p
Please enter your choice of breakfast
How would you like your eggs?
You can have them fried, scrambaled,
Please enter your choice of eggs from
How would you like your eggs boiled?
You can have them hard or soft.
Please enter hard or soft: soft
Thank you! Your soft boiled eggs will
Enjoy your breakfast
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags