Advertisement
zhongnaomi

divide the cost of a meal in a restaurant V1

Jan 11th, 2019
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. print("Hi, I am Marvin, your personal bot.")
  2. command = input("How can I help? ")
  3. if command == "divide the cost of a meal in a restaurant":
  4.     food = []
  5.     R1 = input ( "How many items are in a meal in a restaurant ? ")
  6.     i =0
  7.     j = 0
  8.     k =0
  9.     for item_number in range(int(R1)):
  10.         item = input ( "What is the item " + str(item_number+1) + "  in a meal in a restaurant ? " )
  11.         food.append(item)
  12.         cost1= input ( "What is the list price of the  "  + item + "  in restaurant ? " )
  13.         cost_R = input( " What is the price of the " + item + " in market?  " )
  14.         i = i + int(cost1)
  15.         j = j + int(cost_R)
  16. k = (j / i) *100  
  17.  
  18. print ( "the food if I go to buy myself in the market is " + str(k) + "% I spent in a restaurant that night." )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement