title: Try: Except: always returns the Except
body: <p>I'm facing the following problem in Python 2.x:</p>
  
  <p>Basically, I'm getting a variable's current and previous value with each iteration. On the first iteration prev_var won't be defined just yet so I tried using the Try Except function, but for some reason the Except... option is always returned with each iteration so prev_var is always equal to var. Is there a fix / more elegant way of doing this?</p>
  
  <p>Sorry for the non code block, I'm doing this on my phone. </p>
  
  <pre><code>def main():
      var = 0
  
      try:
          prev_var = prev_var
      except NameError:
          prev_var = var
  
      #then at the end of main:
      prev_var = var
      var += 1
  </code></pre>
  
  <p>Sorry for my noobishness.  Thanks for your time. I'm using Cinema 4d, if it matters.</p>