title: python recursion is not working as expected
body: <p>I'm new to coding and trying to teach myself about recursion by building a very simple function that calls itself.  However my code is behaving slightly differently to how I was expecting:</p>
  <h1>get user input number that must not be greater than 50</h1>
  <pre><code>def getinput():
    input = int(raw_input(&quot;type number under 50 &gt;&gt;&gt; &quot;))
    if input &lt; 50:
      return input
    else:
      print input, &quot;no, must be under 50&quot;
      getinput()
  
  print getinput()
  </code></pre>
  <p>This results in the following behavior:</p>
  <h1>This bit as expected</h1>
  <p>C:\Python27&gt;python recur.py</p>
  <p>type number under 50 &gt;&gt;&gt; 23</p>
  <p>23</p>
  <h1>This bit unexpected</h1>
  <p>C:\Python27&gt;python recur.py</p>
  <p>type number under 50 &gt;&gt;&gt; 63</p>
  <p>63 no, must be under 50</p>
  <p>type number under 50 &gt;&gt;&gt; 23</p>
  <p>None</p>
  <p>My question is, why is the last line &quot;None&quot;, and not 23?  My code seems to correctly call the function again if the user inputs a number 50 or greater, but why doesn't the second call return 23 (the same as the initial output)?</p>
  <p>Any advice much appreciated</p>