Non-Local Assignment Persistent Local State Demo def make_withdraw(balance): """Return a withdraw function with a starting balance.""" def withdraw(amount): Declare the name "balance"nonlocal at the top of the nonlocal balance body of the function in which it is re-assigned if amount balance: return Insufficient funds' balancebalance amount Re-bind balance in the first non-local frame in which it was bound previously return balance return withdrawNon-Local Assignment & Persistent Local State def make_withdraw(balance): """Return a withdraw function with a starting balance.""" def withdraw(amount): nonlocal balance if amount > balance: return 'Insufficient funds' balance = balance - amount return balance return withdraw Declare the name "balance" nonlocal at the top of the body of the function in which it is re-assigned Re-bind balance in the first non-local frame in which it was bound previously 10 Demo