GST Billing System
GST Billing System
---------------------------------
def calculate_gst(price, gst_rate):
"""Calculate GST and return GST amount and total price including GST."""
gst_amount = (price * gst_rate) / 100
total_price = price + gst_amount
return gst_amount, total_price
def generate_bill(items):
"""Generate and display the bill."""
print("\n--------- GST BILL ---------")
print("{:<20} {:<10} {:<10} {:<10}".format("Item", "Price", "GST(%)", "Total"))
print("-" * 50)
total_cost = 0
total_gst = 0
print("-" * 50)
print(f"Total GST Amount: {total_gst:.2f}")
print(f"Total Amount (incl. GST): {total_cost:.2f}")
print("-" * 50)
def main():
print("Welcome to the GST Billing System")
items = []
while True:
name = input("Enter item name: ")
price = float(input("Enter item price: "))
gst_rate = float(input("Enter GST rate (%): "))
generate_bill(items)
if __name__ == "__main__":
main()