Advertisement
zhongnaomi

calculate a discount for my basket 2

Jan 11th, 2019
561
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. print("Hi, I am Marvin, your personal bot.")
  2. command = input("How can I help? ")
  3. if command == "calculate a discount for my basket":
  4.     shopping = []
  5.     R1 = input ( "How many items are in your basket ? ")
  6.     save = 0
  7.     for item_number in range(int(R1)):
  8.         item = input ( "What is the item " + str(item_number+1) + "  you wish to buy ? " )
  9.         shopping.append(item)
  10.         cost1= input ( "What is the list price of the  "  + item + "  you wish to buy today ? " )
  11.         cost_off = input( " What is the percentage discount for  the " + item + "? " )
  12.         save = save + int(cost1)*(int(cost_off)/100)
  13.    
  14.    
  15.  
  16. print ( "You will save  " + str(save) + " RMB. " )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement