Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. purchases = [["matte pink paint","floral wallpaper","magnolia gloss paint","weed killer","picture frame","plug socket","doorbell","matte white paint","tiles","grass seed","lawn mower"],["decorating","decorating","decorating","gardening","decorating","electrics","electrics","decorating","decorating","gardening","gardening"],[6.99,7.99,5.49,2.99,8.99,6.99,15.99,4.99,19.99,1.99,129.99]]
  2.  
  3. reductions = [(),(),(),(),(),(),()]
  4. col = 0
  5. row = 0
  6. total = 0
  7. num = 0
  8. price = 0
  9.  
  10. while row<len(purchases[1]):
  11. if purchases[1][row] == "decorating":
  12. total = total + purchases[2][row]
  13. row = row + 1
  14.  
  15. if total > 20:
  16. row = 0
  17. while row<len(purchases[1]):
  18. if purchases[1][row] == "gardening":
  19. reductions[num] = row
  20. num = num + 1
  21. row = row + 1
  22.  
  23. row = 0
  24.  
  25. while row<len(purchases[1]):
  26. print(purchases[0][row]," £",purchases[2][row])
  27. price = price + purchases[2][row]
  28. if row in reductions:
  29. discount = purchases[2][row]/10
  30. print("-£",discount," discount")
  31. price = price - discount
  32. row = row + 1
  33.  
  34. print("--------------------------")
  35. print("TOTAL = ",price)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement