menu_list =[ {"id": 1, "name":"1. Sweet and Sour Spare Ribs ","price":34,"$":" element "}, {"id": 2, "name":
"2. Sweet and sour fish ", "price": 23,"$":" element "}, {"id": 3, "name":"3. Saute Spicy Chicken ", "price": 65,"$":" element "}, {
"id": 4, "name":"4. braised pork in brown sauce ", "price": 66,"$":" element "}, {"id": 5, "name":"5. Braised Pork with Preserved Vegetable in Soya Sauce ","price"
:21,"$":" element "}] Order_list = [] print(
'========================== Welcome to Wang Laogou restaurant , Have a good meal ===================================='
) print(' Today's menu :') for menu in menu_list: print(menu.get('name'),menu.get('price')
,menu.get('$')) while True: print('='*50) print("1. Customer order \n2. Cancel ordering \n3. Confirm menu \n4. Check out ")
server= int(input(" Please select service :")) if server == 1: while True: menu_add = input(
" Please input the dish name number or input Y Finish ordering :") if menu_add.upper() != 'Y': for m in menu_list: if m.get(
'id')== int(menu_add): Order_list.append(m) break else: print(
'================== Ordered =====================') total_price = 0 for order in
Order_list: print(order.get('name'),order.get('price'),order.get('$'))
total_price+= int(order.get('price')) print(' Subtotal :{} element '.format(total_price)) break
elif server == 2: menu_del = input(" Please enter the dish name to cancel :") for order in Order_list: if
order.get('id') == int(menu_del): Order_list.remove(order) print(
'================== Ordered =====================') total_price = 0 for order in
Order_list: print(order.get('name'),order.get('price'),order.get('$'))
total_price+= int(order.get('price')) print(' Subtotal :{} element '.format(total_price)) elif
server== 3: print('================== Ordered =====================') total_price = 0
for order in Order_list: print(order.get('name'),order.get('price'),order.get(
'$')) total_price += int(order.get('price')) print(' Subtotal :{} element '.format(total_price)
) elif server == 4: print('================= Your consumption menu =======================')
total_price= 0 for order in Order_list: print(order.get('name'),order.get(
'price'),order.get('$')) total_price += int(order.get('price')) print('
Total consumption :{} element '.format(total_price)) print(
'================== Welcome to visit again , bye !=====================') break
Technology