I have just started learning python and written a procedure to calculate factorial of a number. I am getting a logical error. The value returned by fact function is None and the value of factorial after execution is 24.
factorial = 1
def fact(num) :
    if num == 0 :
        return 1
    global factorial
    print factorial
    factorial *= num
    if num-1 > 1 :
        fact(num - 1)
    else :
        return factorial
print fact(4)
print factorial
Output :
1
4
12
None
24
 
    