I expect 'True' but get 'None'
<p>I have a simple python script that recursively checks to see if a range of <code>n</code> numbers are factors of a number <code>x</code>.  If any of the numbers are not factors I return <code>False</code>, otherwise when the n=1 I would like return <code>True</code>. However I keep returning <code>NoneType</code> and would appreciate suggestions on how to fix this.</p>

<p>thanks,
zach cp</p>

<pre><code>#Function
def recursive_factor_test(x, n):
    if n==1:
        return True
    else: 
        if  x % n == 0:
            #print "passed {}".format(n)
            recursive_factor_test(x,n-1)
        else:
            return False

#Example Expecting False
print recursive_factor_test(5041,7)
&gt;&gt;False
#Example Expecting True
print recursive_factor_test(5040,7)
&gt;&gt;None
type(recursive_factor_test(5040,7))
&gt;&gt;NoneType
</code></pre>
