Computer Programming Laboratory 2
Computer Programming Laboratory 2
print("Total Purchase")
prices={
"egg":5,
"loaf bread":70,
"coffee":10,
"apple":30,
"yogurt":44.20
}
purchase={
"egg":12,
"loaf bread":1,
"coffee":10,
"apple":3,
"yogurt":2,
}
sales_tax=0.06
subtotal=0
for x in prices:
subtotal=subtotal+prices[x]*purchase[x]
total_sales_tax=subtotal*sales_tax
total=subtotal+total_sales_tax
print("subtotal:")
print(subtotal)
print("total_sales_tax:")
print(total_sales_tax)
print("total amount after tax:")
print(total)