A customer in a store is purchasing 5 items. Write a python program that asks for the price of each item and display the subtotal of the sales tax to pay (assume 7 % ) then the Overall Total.

Respuesta :

Answer:

total = 0

for i in range(5):

 product = float(input())

 tax = product * 0.07

 print('Product price:',product)

 print('Product tax:',tax)

 print('----------------------')

 total += product+tax

print('Total:',total)

Explanation:

Step 1 variables definition

total = 0

Step 2 loop over quantity of products

for i in range(5):

Step 3 ask for price and calculate the tax

product = float(input())

tax = product * 0.07

Step 4 print the product total

 print('Product price:',product)

 print('Product tax:',tax)

 print('----------------------')

Step 5 print the general total

print('Total:',total)