I understand how the accumulator function works, but how come the curr variable has to be a list? Why doesn't the following work?
def make_acc(start=0):
"""accumulator generator """
curr = start
def acc(inc):
curr += inc
return curr
return acc I get the error "UnboundLocalError: local variable 'curr' referenced before assignment".