Project
Shopping bill with GST
Read items and prices, add them up, apply a discount and GST, and print a bill.
- The first line is the number of items n. Each of the next n lines has an item name and its price separated by a space (for example
pen 25). PrintSubtotal:followed by the total of the prices. - Add a discount: if the subtotal is more than 1000, take 10% off. Print
Discount:and the discount amount (0 if there is none) as a number with 2 decimals, using an f-string likef"{discount:.2f}". - Add 18% GST on the amount after the discount. Print two more lines:
GST:andTotal:, both with 2 decimals.
Line 1, column 1Tab indents 4 spaces. Press Esc then Tab to leave the editor.