Why my code results in infinite loop?
<p>I am novice to python. While I was trying to write simple code, I have faced a peculiar problem which I could not understand. Following is the code</p>

<pre><code>def myLog(x, b):
    temp = b
    def mylog(x,b):
        while b &lt;= x :
            mylog(x,b*temp)
        return b/temp - 1
    return mylog(x,b)
myLog(16,2)
</code></pre>

<p>Why does this code result in an infinite loop?</p>

<p><strong>EDIT:</strong>
I found out the reason why it results in infinite loop. This is the modified code. I forget to use <strong>return</strong> statement inside the inner function definition</p>

<pre><code>    def myLog(x, b):
        temp = b
        def mylog(x,b):
             while b &lt;= x :
                  return mylog(x,b*temp)
             return b/temp - 1
        return mylog(x,b)
</code></pre>

<p>myLog(16,2)</p>
