Advertisement
Vesna_To

for1

Aug 14th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. shopping = []
  2. count = 0
  3. total_price = 0
  4. koliko = int(input("How many items of shopping do You have? "))
  5.  
  6. for i in range (koliko):
  7. item= input("What is item number " + str(i+1) +"? ")
  8. shopping.append(item)
  9. cost = float(input("What is the price of " + item + " ? "))
  10. pieces = int(input("How many pieces of " + item + " do you need? "))
  11. total_price = total_price + pieces * cost
  12. print ("You have ", koliko, "items in Your shopping list. These are:")
  13. for i in shopping:
  14. print(i)
  15. print ("The total price is ", total_price, "$")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement