title: Using int() with decimal numbers
body: <p>I have a piece of code for data validating user input to ensure only numbers greater than zero are taken, as below:</p>
  
  <pre><code>while True:
  x = raw_input("Please enter a number greater than zero.")
  try:
      x = int(x)
      num = True
  except ValueError:
      print "Sorry, you entered an invalid input. Please ensure you enter only numbers  greater than zero."
  if x &gt; 0:
      if num == True:
              break
  elif x &lt;= 0:
      print "Sorry, you entered an invalid input for time. Please ensure you enter only positive numbers. \n"
  </code></pre>
  
  <p>However, this statement is catching decimal numbers greater than zero, which I want to allow through. What should I change in order to prevent this from happening?</p>
  
  <p>P.S: Also, could anyone explain precisely <em>why</em> it's happening?</p>