|
27 | 27 | "Butter Naan": 30, |
28 | 28 | """) |
29 | 29 |
|
30 | | -total_order = 0 |
31 | | - |
32 | | -item1 = input("enter item name: ") |
33 | | -if item1 in menu: |
34 | | - total_order += menu[item1] |
35 | | - print(f"{item1} is added to your order") |
36 | | -else: |
37 | | - print(f"{item1} not found in menu") |
38 | | - |
39 | | -item2= input("enter another item name:") |
40 | | - |
41 | | -if item2 in menu: |
42 | | - print(f"{item2} is added to your order!!") |
43 | | - total_order += menu[item2] |
44 | | -else: |
45 | | - print(f"{item2} not found in menu") |
46 | | -print(f"your total order is {total_order}") |
47 | | - |
48 | | - |
49 | | - |
50 | | - |
51 | | - |
52 | | - |
53 | | - |
54 | | - |
55 | | - |
56 | | - |
57 | | - |
58 | | - |
59 | | - |
60 | | - |
61 | | - |
62 | | - |
63 | | - |
64 | | - |
65 | | - |
66 | | - |
67 | | - |
68 | | - |
69 | | - |
70 | | - |
71 | | - |
72 | | - |
73 | | - |
74 | | -# # Show menu to user |
75 | | -# print("🍽️ Welcome to Vikram's Restaurant!") |
76 | | -# print("Here's our menu:\n") |
77 | | -# for item, price in restaurant_menu.items(): |
78 | | -# print(f"{item} - ₹{price}") |
79 | | - |
80 | | -# print("\n📝 Let's take your order (type 'done' to finish):\n") |
81 | | - |
82 | | -# # Take order from user |
83 | | -# order = {} |
84 | | -# while True: |
85 | | -# item = input("Enter item name: ").strip() |
86 | | -# if item.lower() == 'done': |
87 | | -# break |
88 | | -# elif item in restaurant_menu: |
89 | | -# try: |
90 | | -# quantity = int(input(f"Enter quantity for {item}: ")) |
91 | | -# if item in order: |
92 | | -# order[item] += quantity |
93 | | -# else: |
94 | | -# order[item] = quantity |
95 | | -# except ValueError: |
96 | | -# print("❌ Please enter a valid number.") |
97 | | -# else: |
98 | | -# print("❌ Item not found in menu.") |
99 | | - |
100 | | -# # Calculate total bill |
101 | | -# print("\n🧾 Your Bill Summary:\n") |
102 | | -# total = 0 |
103 | | -# for item, quantity in order.items(): |
104 | | -# price = restaurant_menu[item] |
105 | | -# cost = price * quantity |
106 | | -# total += cost |
107 | | -# print(f"{item} x {quantity} = ₹{cost}") |
108 | | - |
109 | | -# print(f"\n💰 Total Amount to Pay: ₹{total}") |
110 | | -# print("\n🙏 Thank you for dining with us, come again!") |
| 30 | +# Show menu to user |
| 31 | +print("🍽️ Welcome to Vikram's Restaurant!") |
| 32 | +print("Here's our menu:\n") |
| 33 | +for item, price in restaurant_menu.items(): |
| 34 | + print(f"{item} - ₹{price}") |
| 35 | + |
| 36 | +print("\n📝 Let's take your order (type 'done' to finish):\n") |
| 37 | + |
| 38 | +# Take order from user |
| 39 | +order = {} |
| 40 | +while True: |
| 41 | + item = input("Enter item name: ").strip() |
| 42 | + if item.lower() == 'done': |
| 43 | + break |
| 44 | + elif item in restaurant_menu: |
| 45 | + try: |
| 46 | + quantity = int(input(f"Enter quantity for {item}: ")) |
| 47 | + if item in order: |
| 48 | + order[item] += quantity |
| 49 | + else: |
| 50 | + order[item] = quantity |
| 51 | + except ValueError: |
| 52 | + print("❌ Please enter a valid number.") |
| 53 | + else: |
| 54 | + print("❌ Item not found in menu.") |
| 55 | + |
| 56 | +# Calculate total bill |
| 57 | +print("\n🧾 Your Bill Summary:\n") |
| 58 | +total = 0 |
| 59 | +for item, quantity in order.items(): |
| 60 | + price = restaurant_menu[item] |
| 61 | + cost = price * quantity |
| 62 | + total += cost |
| 63 | + print(f"{item} x {quantity} = ₹{cost}") |
| 64 | + |
| 65 | +print(f"\n💰 Total Amount to Pay: ₹{total}") |
| 66 | +print("\n🙏 Thank you for dining with us, come again!") |
111 | 67 |
|
0 commit comments