title: Is there any way I can block an integer from changing its value?
body: <p>Is there any way to make an integer value locked in place so that trying to edit it (<code>i += 1</code>) has no effect? Example:</p>
  <pre><code>i = 0
  
  while i &lt; 10:
      i += 1
  
  if i == 10:
      #lock the integer
  </code></pre>
  <p>I have a problem with this because if the value goes over a limit the program crashes. I could use try except but it would be better to somehow stop the exception from happening in the first place. Any help appreciated :).</p>