title: How can I raise an EOF error?
body: <p>I am a newbie learning python. Please take a look at the below code (From Data Structures and Algorithms in Python by Goodrich, et al).</p>
  
  <pre><code>age = -1   # an initially invalid choice
  while age &lt;= 0:
      try:
          age = int(input('Enter your age in years: '))
          if age &lt;= 0:
              print('Your age must be positive.')
      except ValueError:
          print('That is an invalid age specification.')
      except EOFError:
          print('There was an unexpected error reading input.')
          raise  # let's re-raise this exception.
  </code></pre>
  
  <p>I know what ValueError is. For example the ValueError occurs if the input is given as characters instead of an integer.</p>
  
  <p>On the other hand, I have no idea when EOFError raises.</p>
  
  <ol>
  <li><p>I can't get what 're-raise this exception' means</p></li>
  <li><p>The book says, 'the call to input will raise an EOFError if the console input fails.' Again, I have no idea what console input is and when console input fails.</p></li>
  </ol>
  
  <p>I have tried several ways of raising EOFError, but every time I tried there was only ValueError. Can someone give me some idea?</p>
  
  <p>Thanks in advance.</p>