title: Changing values of the array but the code does not go into the if else statement (Python)
body: <p>The Code does not go in the If Statement no matter what (where I intend to alter the array &quot;dop&quot;, I have no idea why. Any Help will be appreciated</p>
  <pre><code>#The Array dop
  dop = [&quot;1878[1879]&quot;,&quot;1877&quot;,&quot;[2016]2015&quot;,&quot;1874&quot;,&quot;[2871]2987&quot;,&quot;3012[2019]&quot;]
  
  i = 0;
  
  #Used Try Catch Block because of the Type Error that occurs when '[' is not found in an array 
  #Element
  while(i &lt; 6):
     try:
       strObject = dop[i]
       print(strObject)
       indexOne = strObject.index('[',0)
       indexTwo = strObject.index(']',0)
  
       print(indexOne)
       print(indexTwo)
  
       if (indexOne != 0 | indexOne != -1):
           substringObject = strObject[0:indexOne]
           dop[i] = substringObject
           i = i+1
           print(i)
       elif (indexOne == -1):
           i = i+1
       elif (indexOne == 0):
           substringObject = strObject[indexTwo]
           dop[i] = substringObject
           i = i+1
     except ValueError:
         print(&quot;Goes Here&quot;)
         i = i+1
         print(i)
     i = i+1
  </code></pre>