Factorial

    0

    1

    Aakanksha Priya

    Find the factorial of a given number

    def factorial(n):
        if (n==1 or n==0):
            return 1
        else:
            return (n*factorial(n-1))
    n = int(input("Enter number: "))
    print("The factorial of ",n," is: ",factorial(n))
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.