title: How do I make my script take only numeric inputs without screwing it up
body: <p>I've been banging my head against the wall with this task and I can't seem to figure it out for the life of me. </p>
  
  <p>I want to write a script that would prompt a user to input a number and store that number in a list every time after they input the number. When the user would just press enter and not input anything, the script would then print out the highest number in the list.</p>
  
  <p>This is what I wrote so far:</p>
  
  <pre><code>x = 0
  mylist = []
  while x != '':
      x = input("enter a number:")
      mylist.append(x)
      if x == '':
          print(max(mylist))
  </code></pre>
  
  <p>There are two problems with this code that I can see:</p>
  
  <ol>
  <li><p>The user can input a string (I tried fixing that by saying x = int(input(...), but that only lead to a new error:</p>
  
  <pre><code>ValueError: invalid literal for int() with base 10: ''
  </code></pre></li>
  <li><p>print(max(mylist)) only prints out the number with the largest initial integer. For instance, if the user inputs 51 and 112, it would print out 51.</p></li>
  </ol>
  
  <p>Thank you for taking your time in helping me out. </p>