Invoice with @dataclass holding number: str, amount: float, and paid: bool = False, then add a regular method outstanding() returning amount when unpaid else 0. Dataclasses generate __init__, __repr__ and __eq__ for you.Invoice('INV-1', 500.0).outstanding()500.0
paid defaulted to False so the amount is outstanding.
from dataclasses import dataclass.
Methods work exactly as in normal classes.