title: difference between not i==j and i is not j
body: <p>i was creating this program which checks whether 2 items on a list add up to a certain amount of credits i have however each item should be counted only once..</p>
  
  <p>the first part was giving me the correct solution while the second one was executing some cases twice..</p>
  
  <p>so what exactly would the difference between 'not e==j' and 'e is not j' be?</p>
  
  <pre><code>for j in range(len(prices)):
      for e in range(j,len(prices)):
          if(int(prices[j])+int(prices[e])==creds and (not e==j)):
              if(j&lt;e):
                      something
              else:
                      something
  
  for j in range(len(prices)):
      for e in range(j,len(prices)):
          if(int(prices[j])+int(prices[e])==creds and (e is not j)):
              if(j&lt;e):
                      something
              else:
                      something
  </code></pre>