Advertisement
banjothorn

Untitled

Oct 31st, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. how_many = int(input("how many items do you need? "))
  2. shopping = [[], []]
  3.  
  4. for item_number in range(how_many):
  5. item = input("what is item " + str(item_number) + " ? ")
  6. shopping[0].append(item)
  7. price = float(input("how much does that cost? "))
  8. shopping[1].append(price)
  9.  
  10. count = 0
  11. item2 = -1
  12. price = 0
  13. print
  14. print("you have " + str(how_many) + " items in your shopping list:")
  15. print()
  16. print()
  17. print(" CUSTOMER SHOPPING LIST")
  18. for item in shopping[0]:
  19. item2 = int(item2 + 1)
  20.  
  21. price = shopping[1][item2]
  22.  
  23. print(" " + (item) + " costing " + str(price))
  24.  
  25. total = 0
  26. for item_number in range(how_many):
  27. total = total + shopping[1][count]
  28. count = count + 1
  29.  
  30. print("the total for your groceries will be " + str(total))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement