title: Why does this UnboundLocalError occur (closure)?
body: <p>What am I doing wrong here?</p>
  <pre><code>counter = 0
  
  def increment():
    counter += 1
  
  increment()
  </code></pre>
  <p>The above code throws an <code>UnboundLocalError</code>.</p>