Recursion code not working as expected - Python 3
<p>I am a beginner to programming and in this case cannot understand why this Python code doesn't work as expected.</p>

<p>I am trying to use recursion by calling a function within a function; calling the function n times, and reducing n by 1 to 0 with each loop at which point it will stop.</p>

<p>Instead my code prints 'freak' once, then I get a 'maximum recursion depth' error message.</p>

<pre><code>def print_m():
    print ('freak')

def do_n(arg, n)):
    if n &gt;= 0:
        print (do_n(arg,n))
        n = n - 1
</code></pre>

<p>Passing <code>n-1</code> as parameter to recursive call fixes the problem.</p>

python recursion