title: How to test a variable if it changes or not? Python
body: <p>I am quite new to python.</p>
  
  <p>Roughly i want to do the following:</p>
  
  <pre><code>var=0
  while x doesn't change
     return var
  
     if x changes
        var = var + 1
  </code></pre>
  
  <p>This shall then be continued until all x-values are processed. I don't have a list of the x-values.</p>
  
  <p>Any suggestions how to get from my ideas to code?</p>
  
  <p>I am working in field calculator in Arcmap.</p>