title: TypeError: 'in <string>' requires string as left operand, not int
body: <p>Why am I getting this error in the very basic Python script?  What does the error mean?</p>
  
  <p>Error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "cab.py", line 16, in &lt;module&gt;
      if cab in line:
  TypeError: 'in &lt;string&gt;' requires string as left operand, not int
  </code></pre>
  
  <p>Script:</p>
  
  <pre><code>import re
  import sys
  
  #loco = sys.argv[1]
  cab = 6176
  fileZ = open('cabs.txt')
  fileZ = list(set(fileZ))
  
  for line in fileZ:
       if cab in line: 
          IPaddr = (line.strip().split())
          print(IPaddr[4])
  </code></pre>