title: How do I reject all inputs that are NOT integers?
body: <p>I need help to solve the following problem:<br>
  Expected output:</p>
  
  <blockquote>
    <p>Please input an integer: sfasf;jk<br>
    Error. Please input an INTEGER: 1<br>
    You input 1  </p>
  </blockquote>
  
  <p>My code:  </p>
  
  <pre><code>num=input("Please input an integer: ")
  while type(num)!=int:
      num=input("Error. Please input an INTEGER: ")
  print("You input",num)
  </code></pre>
  
  <p>Problem:<br>
  I want my code to keep looping until an <strong>integer</strong> is input. But, no matter what input I give, the code keeps rejecting it even if my input is an integer. How do I check whether my input is an integer or not? Inputs like string and floats must all be rejected according to my question.</p>