# bill_calculator.py

def calculate_due():
    bill = float(input("Enter bill amount: $"))
    paid = float(input("Enter paid amount: $"))
    due = bill - paid
    
    print(f"\nBill: ${bill:.2f}")
    print(f"Paid: ${paid:.2f}")
    print("-" * 20)
    
    if due > 0:
        print(f"Due: ${due:.2f}")
    elif due < 0:
        print(f"Change: ${abs(due):.2f}")
    else:
        print("Paid in full!")
    
    return due

if __name__ == "__main__":
    calculate_due()

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: