Python Nested Function Set Outer Variable Expenses