当前位置:   article > 正文

python 简单点餐系统_餐厅收银系统python

餐厅收银系统python
menu_list =[
		{"id": 1, "name":"1.糖醋排骨","price":34,"$":"元"},
		{"id": 2, "name":"2.糖醋鱼", "price": 23,"$":"元"},
       	{"id": 3, "name":"3.大盘鸡", "price": 65,"$":"元"},
       	{"id": 4, "name":"4.红烧肉", "price": 66,"$":"元"},
       	{"id": 5, "name":"5.梅菜扣肉","price":21,"$":"元"}]
Order_list = []
print('==========================欢迎光临王老狗饭馆,祝您用餐愉快====================================')
print('今日菜单:')
for menu in menu_list:
	print(menu.get('name'),menu.get('price'),menu.get('$'))
while True:  
	print('='*50)
	print("1.用户点餐\n2.取消点餐\n3.确认菜单\n4.结账")
	server = int(input("请选择服务:"))
	if server == 1:
		while True:
			menu_add = input("请输入菜名编号或输入Y结束点菜:")
			if menu_add.upper() != 'Y':
				for m in menu_list:
					if m.get('id')== int(menu_add):
						Order_list.append(m)
						break
			else:
				print('==================已点菜=====================')
				total_price = 0
				for order in Order_list:
					print(order.get('name'),order.get('price'),order.get('$'))
					total_price += int(order.get('price'))					
				print('                           小计:{}元'.format(total_price))
				break
	elif server == 2:
		menu_del = input("请输入要取消的菜名:")
		for order in Order_list:
			if order.get('id') == int(menu_del):
				Order_list.remove(order)

		print('==================已点菜=====================')
		total_price = 0
		for order in Order_list:
			print(order.get('name'),order.get('price'),order.get('$'))
			total_price += int(order.get('price'))					
		print('                           小计:{}元'.format(total_price))
	elif server == 3:
		print('==================已点菜=====================')
		total_price = 0
		for order in Order_list:
			print(order.get('name'),order.get('price'),order.get('$'))
			total_price += int(order.get('price'))					
		print('                           小计:{}元'.format(total_price))         
	elif server == 4:  
		print('=================您的消费菜单=======================')     
		total_price = 0
		for order in Order_list:
			print(order.get('name'),order.get('price'),order.get('$'))
			total_price += int(order.get('price'))
		
		print('           总计消费:{}元'.format(total_price))
			
		print('==================欢迎您再次光临,再见!=====================')
		break
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/80644
推荐阅读
相关标签
  

闽ICP备14008679号