---
# System prepended metadata

title: Untitled

---

```
class Balance:
    def __init__(self):
        self.bal = 0

    def add(self, x):
        self.bal += x
        return self

    def deduct(self, x):
        self.bal -= x
        return self

b = Balance()
b.add(7).deduct(2).add(5)
print(b.bal)
```