# Chapter 21 example: a local inside the function resets every call.

def counter_step():
    count = 0
    count = count + 1
    return count

print(counter_step())   # 1
print(counter_step())   # 1
print(counter_step())   # 1

# A variable OUTSIDE the function is shared across calls:

count = 0

def step():
    global count
    count = count + 1
    return count

print(step())   # 1
print(step())   # 2
print(step())   # 3
