title: How to only accept integer between 3-8 and not strings? (Python 2.7.5)
body: <p>I'm trying to make a function that asks for an integer between 3-8 and will continue asking until the user inputs an integer between 3-8. So it will ask again if you enter 0, -1, 9 or "rabbits".</p>
  
  <p>So far I have this:</p>
  
  <pre><code>def GetNumberOfColours():
      NumberOfColours = None
      while type(NumberOfColours) != int or int(NumberOfColours) &lt; 3 or int(NumberOfColours) &gt; 8:
          print "Please enter the amount of colours you would like to play with (min 3, max 8)."
          NumberOfColours = raw_input()
      NumberOfColours = int(NumberOfColours)
  </code></pre>
  
  <p>But this code at the moment won't work as it takes the raw input and won't see it as an integer if it is. But if I use input() then it won't accept a string which could be input and stop the code.
  How can I make this work?</p>