프로그래밍 언어 활용난도 중
11번 · 주관식 · 5점
다음 Python 프로그램의 출력값을 쓰시오.
def make_accumulator():
total = 0
def add(value):
nonlocal total
total += value
return total
return add
a = make_accumulator()
b = make_accumulator()
print(a(2), a(3), b(4), a(-1))