Q.No.:38
Write a python program to input price of items and calculate the sales tax on 6%. Also, display its output.
Example:
Enter the number of items which you want to buy:5
Enter the price of an item:120
Enter the price of an item:100
Enter the price of an item:350
Enter the price of an item:450
Enter the price of an item:840
Sub_total: 1860
Sales tax 1116.0
Amount including sales tax: 2976.0
Answers
Answered by
1
Code:
num=int(input("Enter the number of items which you want to buy:"))
items=[]
for i in range(num):
price=float(input("Enter the price of an item:"))
items.append(price)
cost, tax = 0, 0
for i in items:
cost+=i
tax+=6/100*i
print("Sub_total:", cost)
print("Sales tax", tax)
print("Amount including sales tax:", cost+tax)
Similar questions
Business Studies,
3 months ago
Science,
3 months ago
World Languages,
3 months ago
Sociology,
8 months ago
History,
1 year ago
Accountancy,
1 year ago