A class bundles state and behavior. `__init__` initializes new instances, and `self` refers to the instance within methods.
python
class Wallet:
def __init__(self, address, balance=0):
self.address = address
self.balance = balance
def deposit(self, amount):
self.balance += amount
w = Wallet("0xabc")
w.deposit(5)`__repr__` controls how an object prints for debugging; `__eq__` controls `==` comparisons. Without them, instances compare by identity and print as `<Wallet object at 0x...>`.