Skip to content

Instantly share code, notes, and snippets.

@codeboy101
Last active January 6, 2016 17:50
Show Gist options
  • Save codeboy101/3b2fe6ee08fcee285c06 to your computer and use it in GitHub Desktop.
Save codeboy101/3b2fe6ee08fcee285c06 to your computer and use it in GitHub Desktop.
item = ['burger','fries','pizza'] ## price for burger : 40 , fries : 20 , pizza : 50
price_customer_order = []
customer_order = []
place_order = input("place order")
## now assuming the customer ordered say : 12 say burger and fries
for i in place_order :
if i == "1" :
customer_order.append(item[0])
price_customer_order.append(40)
elif i == "2" :
customer_order.append(item[1])
price_customer_order.append(20)
elif i == "3" :
customer_order.append(item[2])
price_customer_order.append(50)
else :
pass
print("your order : " + str(list(customer_order)) + "\n your total : " + str(list(price_customer_order)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment