python function UnboundLocalError code example Example: UnboundLocalError: counter = 0 def increment(): global counter counter += 1 increment()