practicepython.in
python exercises
starting python
Traceback (most recent call last):
  File "ledger.py", line 12, in <module>
    print(running_totals([100, -30, 45]))
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "ledger.py", line 9, in running_totals
    return [add(amount) for amount in amounts]
            ~~~^^^^^^^^
  File "ledger.py", line 6, in add
    total += amount
    ^^^^^
UnboundLocalError: cannot access local variable 'total' where it is not associated with a value
your_code.py