title: UnboundLocalError: local variable 'z' referenced before assignment
body: <p>I am trying to execute this code,</p>
  
  <pre><code>def getInterPropreCat(h,cat):
      for txt in h:
          if txt['Categorie'] == cat:
              z=[txt['Max'],txt['Min']]
      g=getListZERO(h,cat)
      for text in g:
          z = getInterPropore(text['Min'],text['Max'],z[1],z[0])
          #   print(y)
      return z
  </code></pre>
  
  <p>and I do a test :</p>
  
  <p><code>print(getInterPropreCat(h,cat1))</code>
  it's give me a result then I do a loop to get results of all categories :</p>
  
  <pre><code>for txt in CatList:
     getInterPropreCat(h,txt)
  </code></pre>
  
  <p>and I have this error :</p>
  
  <pre><code>z = getInterPropore(text['Min'],text['Max'],z[1],z[0])
  </code></pre>
  
  <p>UnboundLocalError: local variable 'z' referenced before assignment</p>
  
  <p>any help ?</p>