title: No output from sum of Python regex list
body: <p>The problem is to read the file, look for integers using the re.findall(), looking for a regular expression of '[0-9]+' and then converting the extracted strings to integers and summing up the integers. </p>
  
  <p>MY CODE: in which sample.txt is my text file</p>
  
  <pre><code>import re
  hand = open('sample.txt')
  for line in hand:
      line = line.rstrip()
      x = re.findall('[0-9]+',line)
  print x
  x = [int(i) for i in x]
  add = sum(x)
  print add
  </code></pre>
  
  <p>OUTPUT:</p>
  
  <p><img src="https://i.stack.imgur.com/atBXE.png" alt="enter image description here"></p>