def create_counter():
count = 0
def increment():
nonlocal count
count += 1
return count
return increment
count = create_counter()
### adjust here ###
print(count() == 3) # expected True
Python
Setting up Python environment...
Output