title: simple loops involving error "local variable referenced before assignment..."
body: <p>Python:
  I have researched a lot into this, but as a beginner I don't understand the solutions, let alone apply them to my simple problem:</p>
  
  <pre><code>def min_max(xs):
      xs = []
      for i in xs:
          y = (min, max)
      return y
  </code></pre>
  
  <p>"local variable 'y' referenced before assignment"</p>
  
  <p>I don't understand why this does NOT work!!
  I've defined Y in the line before return, i know there is another way to do it, but i really need to know why this method is wrong!
  Thanks!</p>