Hii ,I was making a factorial program in python using recursion/ but I have one doubt : if I run the program I get the error as : " result=xfact(x-1) TypeError: unsupported operand type(s) for : 'int' and 'NoneType'"
But If I run it with the commented statements it works fine .So my question is in the else why my return statent doesn't work ?

def fact(x):
    if x==1 or x==0:
        #return result
    return y

for i in range(t):

When I try both sets of code with Python 3.4 in VS 2015 they seem to work without errors. Of course that's assuming that when you tried using the result variable you also changed all the instances of the y variable to result.

commented: There was some change from Python 2 that may be why they asked. But I omitted that. OP needs to tell all. +11