title: Python finds char in string even if char is not in string
body: <p>I'm looping through a set of string and chars. I want to find the strings which contain the specified chars and then add the number of this string to see if the sum of the numbers from one char are bigger than the other.</p>
  <p>Problem is that in line 21:</p>
  <pre><code>if char_1 and char_2 in dat:
  </code></pre>
  <p>after the forth time it loops it find the char 'A' in the forth line of the sample:
  210   B C D</p>
  <p>But there is no 'A' in this line.</p>
  <p>Can somebody tell me thy it finds this char in this string?</p>
  <p>Here is my complete code:</p>
  <pre><code>f = open('sample2.txt', 'r')
  file = f.read()
  
  data = []
  chars = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
  in_de = []
  
  for line in file.split('\n'):
      data.append(line)
  
  char_count = 0
  index = 0
  count = 0
  
  while count &lt; len(data):
      count_1 = 0
      count_2 = 0
      for dat in data:
          char_1 = chars[char_count]
          char_2 = chars[char_count+1]
          if char_1 and char_2 in dat:
              count_1 += int(dat[0:3])
              count_2 += int(dat[0:3])
          elif chars[char_count] in dat:
              count_1 += int(dat[0:3])
          elif chars[char_count+1] in dat:
              count_2 += int(dat[0:3])
      if count_1 &gt; count_2:
          in_de.append('increase')
      else:
          in_de.append('decrease')
      char_count += 1
      count += 1
  
  sum = 0
  
  for line in in_de:
      if line == 'increase':
          sum += 1
  
  print(sum)
  </code></pre>
  <p>Here is the sample file:</p>
  <pre><code>199  A
  200  A B
  208  A B C
  210    B C D
  200  E   C D
  207  E F   D
  240  E F G
  269    F G H
  260      G H
  263        H
  </code></pre>