# -*- coding: utf-8 -*- """ Created on Tue Jul 28 10:02:13 2026 @author: ko24009 """ def canteen(): menu = { "pie": 3.50, "chips": 1.50, "chocolate-bar": 2, "noodles": 3, } #this is whats on the menu print ("welcome to the canteen") print ('Available food:') for index, value in menu.items(): #this block is for giving the value and index name print(index, "$" + str(value)) total_cost = 0 order=[] #this assigns a variable to the cost and order for the list while(True): user_choice = input("\nWhat would you like to order (type exit if you would like your total)\n") user_choice = user_choice.strip() user_choice = user_choice.lower() #this is the loop and it prints this thing above everytime if user_choice == "exit": print("you ordered:") #this is for the exit so the user types "exit" and it will print the order for item in order: print("-", item) # still in loop print("Total: $" + str(total_cost)) break #this block is for printing the total price and order after you exit elif user_choice in menu: total_cost += menu[user_choice] order.append(user_choice) print("Your total cost is now $" + str(total_cost)) continue #this is for adding the total price the users order comes too else: print ("this is not available") continue #this is for if you write an item that is not on the menu canteen() #this is jus cause i dont wanna type it into the console