title: How to fix 'NoneType' object cannot be interpreted as an integer error
body: <p>When I write it all in my main the program works fine, but when I put it in a function I get this error ('NoneType' object cannot be interpreted as an integer), im guessing it is because of the prompt and the integer mixed.
  I saw a lot of similar error in stackoverflow but still could not fix mine.
  Any ideas how to fix this?</p>
  
  <p>My function consists of this</p>
  
  <pre><code>def take_value(min, max, prompt) :
  
      value = int(input("input your value"))
  
      while(value &lt; min or value &gt; max) :
          print("Error – re-enter number (min-max)")
          print(prompt)
          value = int(input("input your value"))
          return value
  </code></pre>
  
  <p>And this is the code line in my main which call the function</p>
  
  <pre><code>numCompetitors =take_value(3,16, "Error – Re-enter number of competitors(between 3 and 16 inc)")
  
  for comp in range(0,numCompetitors):
  </code></pre>