Question: Write a simple python program that asks the user for a series of product prices. Compute sales tax (7%) on each price and print out

Write a simple python program that asks the user for a series of product prices. Compute sales tax (7%) on each price and print out the new price to the user. Next, ask the user if they want to enter another price - if they do, repeat the process. If not, end the program. and modify the same program so that your program also keeps track of the total amount spent in addition to the total tax due.

I have asked this question prior and the person posted this below program however after entering each price it has to compute the tax immediately but for the below program tax is computed later. Also kindly write the program without CREATING A EMPTY LIST(which is second step in this case)

num = int(input("Enter the number of Products : ")) # l=[] for i in range(0,num): price = int(input("Enter the price of product = ")) # l.append(price) for i in range(0,num): total_price = l[i] + (l[i] * 0.07) print("price of ",i," product = ",total_price) while(True): choice = input("You want to continue? (Y or N) : ") if(choice == 'N' or choice == 'n'): break price1 = int(input("Enter the price of product = ")) total_price = price1 + (price1*0.07) print("price of product = ",total_price)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!