title: Python error in shell ValueError: invalid literal for int() with base 10:
body: <p>I am writing a program.  if short matches are mixed with longer matches. the program is to see which matches will fit back in the short  box.
  This is my code: </p>
  
  <pre><code>import math
  def q2():
  
      fin = open('input.txt','rt')
      fout = open('output.txt', 'wt')
      a= int(fin.readline().strip())
      b = [int(b) for b in str(a)]
      count = -1
      nMatches = b[0]
      width = b[1]
      heigth = b[2]
      length = width**2 + heigth**2
      length = length**(.5)
      while count &lt;= nMatches:
          match = int(fin.readline().strip())
          count = count+ 1
          if match &lt;= length:
              print('YES')
          else:
              print('NO')
  </code></pre>
  
  <p>This is the output:</p>
  
  <pre><code>YES
  YES
  YES
  NO
  NO
  Traceback (most recent call last):
    File "&lt;pyshell#3&gt;", line 1, in &lt;module&gt;
      q2()
    File "D:/code/Q2/q2.py", line 15, in q2
      match = int(fin.readline().strip())
  ValueError: invalid literal for int() with base 10: ''
  </code></pre>
  
  <p>Thanks for any help
  the content of fin is:
  534
  3
  4
  5
  6
  7</p>