Find_Factorial_using_Function_return_feature.py


Sign up Free. Don't forget to check out our challenges, lessons, solve and learn series and more ...


Code Snippet

def main():
    x=int(input("Enter a number you would like to find a factorial for:>>"))
    print (fact(x))

def fact(x):
    if x == 0:
        return 1
    return x * fact(x - 1)

main()

                    

Try it yourself