title: How to put a group of integers in a row in a text file into a list?
body: <p>I have a text file composed mostly of numbers something like this:</p>
  <pre><code>3  011236547892X
  9  02321489764 Q
  4  031246547873B
  </code></pre>
  <p>I would like to extract each of the following (spaces 5 to 14 (counting from zero)) into a list:</p>
  <pre><code>1236547892
  321489764 
  1246547873
  </code></pre>
  <p>(Please note: each &quot;number&quot; is 10 &quot;characters&quot; long - the second row has a space at the end.)</p>
  <p>and then perform analysis on the contents of each list.</p>
  <p>I have umpteen versions, however I think I am closest with:</p>
  <pre><code>with open('k_d_m.txt') as f:
          for line in f:
              range = line.split()
              num_lst = [x for x in range(3,10)]
  
  print(num_lst)
  </code></pre>
  <p>However I have: TypeError: 'list' object is not callable</p>
  <p>What is the best way forward?</p>
  <p>What I want to do with num_lst is, amongst other things, as follows:</p>
  <p>num_lst = list(map(int, str(num)))</p>
  <p>print(num_lst)</p>
  <p>nth = 2</p>
  <p>odd_total = sum(num_lst[0::nth])
  even_total = sum(num_lst[1::nth])
  print(odd_total)
  print(even_total)</p>
  <p>if odd_total - even_total == 0 or odd_total - even_total == 11:
  print(&quot;The number is ok&quot;)
  else:
  print(&quot;The number is not ok&quot;)</p>