#calculates total price of your items as your shopping
print("The sales tax in Lucas County is 7.25%")
sales_tax = 0.0725
price_total=0
price = float(input("Insert price of item "))
price_tax= price * sales_tax
price_semitotal = price_tax + price
print("Price of that item with tax: ", price_semitotal)
price_total+=price_semitotal
print("Total Price: ", price_total)
How do I change this so that it loops and keeps prompting the user to add more items? I want it to be like a grocery list where you input the price of one item, it calculates the tax for it so that you can see the final price of that one item and the final price of all of your items together. I also tried something like this but it didn't work:
print("The sales tax in Lucas County is 7.25%")
sales_tax = 0.0725
price_total=0
def price(price_input, price_tax, price_semitotal, price_total):
price_input = float(input("Insert price of item "))
return price_tax = price_input * sales_tax
return price_semitotal = price_tax + price
print("Price of that item with tax: ", price_semitotal)
return price_total+=price_semitotal
print("Total Price: ", price_total)
while True:
price