title: Forcing a variable to be an integer
body: <pre><code>errors = int(0)
  for i in range(len(expectedData)):
      if data[i] != expectedData[i]:
          errors += int(binary_compare(data[i], expectedData[i]))
  return errors
  </code></pre>
  
  <p>I have the above code which I am trying to use to calculate some integer (number of errors) for some data.  I have casted everything I can see possible as an integer, yet the line "errors += ..." still appends the value, rather than adds it.  </p>
  
  <p>For example, if my answer should be 7, I might get 500002.  (5 + 0 + 0 + .. + 2).  I have never run into this before.  The function binary_compare is returning an integer as well, but I'm completely in the dark as to why this isn't working.</p>