# Spending money # Collect input name = input("What is your name? ") print(f"Welcome {name} to the canteen The menu today is Wedges $4.50, smoothie $6.50, pies $6.00. hashbrown $1.50, cinnamon scroll $4.00.") budget = float(input("How much is your budget to spend? ")) # Food item variables smoothie = 6.5 pie = 6 cinnamonscroll = 4 wedges = 4.5 hashbrown = 1.5 keep_going = "" new_budget = 0 while keep_going == "": food = input("What do you want to buy? A smoothie, pie, hashbrown, cinnamon scroll or wedges? ") if budget >= hashbrown: if food == "smoothie" and budget >= smoothie: new_budget = budget - smoothie print(f"{name}, you selected smoothie, you have ${new_budget} remaining") elif food == "pie" and budget >= pie: new_budget = budget - pie print(f"{name}, you selected pie, you have ${new_budget} remaining") elif food == "wedges": new_budget = budget - wedges print(f"{name}, you selected wedges, you have ${new_budget} remaining") elif food == "cinnamon scroll": new_budget = budget - cinnamonscroll print(f"{name}, you selected cinnamon scroll, you have ${new_budget} remaining") elif food == "hashbrown": new_budget = budget - hashbrown print(f"{name}, you selected hashbrown, you have ${new_budget} remaining") else: print("You have entered and invalid option or you have insufficient funds.") budget = new_budget if budget < hashbrown: print(f"{name} you have insufficient funds to make another purchase.") break else: keep_going = input("Do you want to select another item? enter no to exit or press the enter button to keep going ") else: print("your to poor sorry") break # Display output print("Program has ended.")