# A Shamelessly Simple E-Restaurant Order

Shopify gets your restaurant online fast. So you can keep cooking without sacrificing what matters.

To get started, a shamelessly simple open-source Python implementation of the above restaurant online order system is discussed.

The simplest restaurant online order system using Python functions is described as follows:

#### Check input numeric validation

def numeric_validation(value):
“”””
This function take an input as interger
and validate that it takes onlu numeric data.
“””
while True:
try:
val = int(input(value))
except:
continue
if val < 0:
continue
else:
break
return val

def order_items(orders):
order_items.total_price = 0
run = True
while run:
orderList = orders
items = numeric_validation(“Enter Item No:”)
if (items in orderList):
continue
else:
items_no = int(items)
qty = numeric_validation(“Quantity:”)
order = input(“Do you want to order more? y/n:”)
if order == ‘y’:
continue
else:
run = False
return order_items

Let’s start main function

print(“#”30+”\n Welcome To DigHiSci Cafe\n”+”#”30+ \

#### Declare Variables

2:{“item”:”coffee”,”price”:2},
3:{“item”:”sandwich”,”price”:4},
}

orders = [] # issue it has to be a dictionary not a list
qty= 1

print(“No#”,item,”: Item: “,value[“item”].title(),”- Price:”+str(value[“price”])+”\$”)
print(‘#’*30)

order_items(orders)
print(‘#’*30)

#### Show card list

print(“You ordered the following Items: “)
for i in range(len(orders)):
print(str(i+1)+”- “+orders[i].title())

#### End

print(‘#’*30+”\nGreat Thanks! Order Again.\n”)

Here is the result:

```##############################
Welcome To DigHiSci Cafe
##############################
No# 1 : Item:  Tea - Price:1\$
No# 2 : Item:  Coffee - Price:2\$
No# 3 : Item:  Sandwich - Price:4\$
No# 4 : Item:  Salad - Price:5\$
##############################
Enter Item No:1
Quantity:1
Do you want to order more? y/n:y
Enter Item No:2
Quantity:1
Do you want to order more? y/n:y
Enter Item No:3
Quantity:1
Do you want to order more? y/n:y
Enter Item No:4
Quantity:1
Do you want to order more? y/n:n
##############################
You have ordered the following Items:
1- Tea
2- Coffee
3- Sandwich