title: Python how to only accept numbers as a input
body: <pre><code>mark= eval(raw_input("What is your mark?"))
  try:
      int(mark)
  except ValueError:
      try:
          float(mark)
      except ValueError:
          print "This is not a number"
  </code></pre>
  
  <p>So I need to make a python program that looks at your mark and gives you varying responses depending on what it is. </p>
  
  <p>However I also need to add a way to stop random text which isn't numbers from being entered into the program. </p>
  
  <p>I thought I had found a solution to this but it won't make it it past the first statement to the failsafe code that is meant to catch it if it was anything but numbers. </p>
  
  <p>So pretty much what happens is if I enter <code>hello</code> instead of a number it fails at the first line and gives me back an error that says <code>exceptions:NameError: name 'happy' is not defined</code>.</p>
  
  <p>How can I change it so that it can make it to the code that gives them the print statement that they need to enter a number?</p>