title: TypeError: 'str' object cannot be interpreted as an integer in if loop python
body: <p>I am trying to execute the following lines in python, however, I got an error and searched for several answer, but still can not find how to solve the problem:</p>
  <p>attached is the script</p>
  <pre><code>import numpy as np
  x=np.array([5,31,41,51,61])
  y=np.array([[1,11,21,31,5],[4,14,24,34,5],
          [7,17,27,37,5],[34,44,54,64,5],[37,47,57,67,5]])
  for i in range(len(x)-1,2,-2):
      if (np.sum(y==x[i],'all')&lt;.1):
          x=x-(x&gt;y(i))
    # Expected   result is x=[[1,11,21,31,5],[4,14,24,34,5],
                              #[7,17,27,37,5],[34,43,52,61,5]
                               # ,[37,46,55,64,5]]
  </code></pre>