Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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]]
- reductions = [(),(),(),(),(),(),()]
- col = 0
- row = 0
- total = 0
- num = 0
- price = 0
- while row<len(purchases[1]):
- if purchases[1][row] == "decorating":
- total = total + purchases[2][row]
- row = row + 1
- if total > 20:
- row = 0
- while row<len(purchases[1]):
- if purchases[1][row] == "gardening":
- reductions[num] = row
- num = num + 1
- row = row + 1
- row = 0
- while row<len(purchases[1]):
- print(purchases[0][row]," £",purchases[2][row])
- price = price + purchases[2][row]
- if row in reductions:
- discount = purchases[2][row]/10
- print("-£",discount," discount")
- price = price - discount
- row = row + 1
- print("--------------------------")
- print("TOTAL = ",price)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement