Write Python. Understand every error.

Starting Python in your browser…

Project

Shopping bill with GST

Read items and prices, add them up, apply a discount and GST, and print a bill.

  1. 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). Print Subtotal: followed by the total of the prices.
  2. 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 like f"{discount:.2f}".
  3. Add 18% GST on the amount after the discount. Print two more lines: GST: and Total: , both with 2 decimals.

Ctrl + Enter to run
Line 1, column 1Tab indents 4 spaces. Press Esc then Tab to leave the editor.