Factorial

    0

    1

    Mahendra Kumar

    beginnermathematics

    To find the factorial of a given number : factorial of 5 = 5 x 4 x 3 x 2 x 1= 120

    import math   #math module
    # take input
    num = 5
    # find factorial of a number and display result
    print('The factorial of',num,'is', math.factorial(num))
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.