Home > other >  Hope god help me to modify the code, thank you very much
Hope god help me to modify the code, thank you very much

Time:10-08

To order, cancel, check out three big functions, but has been unable to realize, we settle display error, hope who is a great god can help me to amend the code, let it run successfully, thank you very much, also hope the modified code to complete send me, thank you

CodePudding user response:

The items (' name ')==i2 is what things?

CodePudding user response:

questions posted pictures, you want to respondents to knock your image code, debugging code for you? Again?

Post code with format text, can help you to modify,

CodePudding user response:

Changed the way the goods stored

 
# coding=utf-8

Menu_list=[' sweet and sour pork ribs', 'sweet and sour fish', 'big chicken', 'braise in soy sauce meat', 'mei food braised pork]
Goods={' sweet and sour pork ribs' : 34, 'big chicken: 35, "braise in soy sauce meat" : 65,' the plum food braised pork: 66, 'sweet and sour fish: 54}
A={}
Order_list=[]

Working for v, k in goods. The items () :
Print (v, k)

While True:
Print (menu_list)
Print (" '
1. Order
2. Cancel the order
3. Check out "')
Server=int (input (' please select service:))
If the server==1:
# order
While True:
Menu_add=input (" please enter the name or input end of the order: Y ')
If menu_add. Upper ()! :='Y'
Order_list. Append (menu_add)
Print (' already bought dishes: {} '. The format (order_list))
The else:
Break

If the server==2:
# to cancel order
Menu_del=input (' please enter to cancel dishes:)
Order_list. Remove (menu_del)

If the server==3:
# check function
Total_price=0
"" "working for v, k in goods. The items () :
Print (v, k) ", "
"For the item in order_list:
Print (' {}, {}. The format (item, goods (item)))
Total_price +=goods (item)
Print (' please pay ')
Print (total_price)
Break
The else:
Print (' output error, please enter the number ')

CodePudding user response:

Thank you, I went back to try to run it
  • Related