A customer in a store is purchasing five items. Design a program in python that asks for the price of each item, and then displays the subtotal of the sale, the amount of the sales tax , and the total. Assume the sales tax is 6 percent.

Here's a tutorial with examples on Python input/output.

http://docs.python.org/tutorial/inputoutput.html

Study them and code accordingly.
If you have difficulties, post your code for help.

A customer in a store is purchasing five items. Design a program in python that asks for the price of each item, and then displays the subtotal of the sale, the amount of the sales tax , and the total. Assume the sales tax is 6 percent.

Sure! Here's a step-by-step solution in Python:

1. Start by initializing a variable `subtotal` to 0, which will store the total price of all items.
2. Create a for loop that will run 5 times (for each item).
3. Inside the loop, prompt the user to enter the price of each item using the `input()` function. Convert the input to a float and store it in a variable, let's say `item_price`.
4. Add the `item_price` to the `subtotal` variable.
5. After the loop ends, calculate the sales tax by multiplying the `subtotal` by 0.06 (6% tax rate). Store the result in a new variable called `tax_amount`.
6. Calculate the `total` by adding the `subtotal` and `tax_amount`.
7. Finally, print the `subtotal`, `tax_amount`, and `total` using the `print()` function.

Here's the complete code:

```python
subtotal = 0

# Step 2: Loop to input prices of each item
for item in range(1, 6):
# Step 3: Prompt user to enter price of each item
item_price = float(input(f"Enter the price of item {item}: "))
# Step 4: Add price to subtotal
subtotal += item_price

# Step 5: Calculate sales tax
tax_amount = subtotal * 0.06

# Step 6: Calculate total
total = subtotal + tax_amount

# Step 7: Print results
print(f"\nSubtotal: ${subtotal:.2f}")
print(f"Sales Tax: ${tax_amount:.2f}")
print(f"Total: ${total:.2f}")
```

Now, when you run this program, it will prompt you to enter the price for each of the five items. After you've entered all the prices, it will display the subtotal, sales tax, and total amount for the sale.

Certainly! Here's a Python program that will allow a user to input the prices of five items, calculate the sales tax, and display the subtotal, sales tax amount, and total:

```python
def calculate_total():
# Initialize variables
subtotal = 0
sales_tax_rate = 0.06

# Get the price of each item from the user
for i in range(5):
price = float(input(f"Enter the price of item {i+1}: "))
subtotal += price

# Calculate sales tax and total
sales_tax = subtotal * sales_tax_rate
total = subtotal + sales_tax

# Display the results
print(f"Subtotal: ${subtotal:.2f}")
print(f"Sales Tax: ${sales_tax:.2f}")
print(f"Total: ${total:.2f}")

# Call the function to run the program
calculate_total()
```

Explanation:
1. The `calculate_total` function is defined to encapsulate the logic of the program.
2. `subtotal` and `sales_tax_rate` variables are initialized to keep track of the subtotal and the sales tax rate (6%).
3. A loop is used to iterate five times to prompt the user to enter the price of each item. The value is converted to a float using `float(input(...))` and added to the `subtotal`.
4. The sales tax is calculated by multiplying the `subtotal` with the `sales_tax_rate`.
5. Finally, the `subtotal`, `sales_tax`, and `total` are displayed with appropriate formatting using `print` statements.

To use this program, you can simply copy and paste it into a Python environment such as IDLE, or save it as a `.py` file and run it with Python. When prompted, input the price for each item, and the program will display the subtotal, sales tax, and total at the end.