Finding out the Prime Factors of a Number

    0

    0

    CrypticSai-08

    def Prime_Factorial(n):
        if n < 4: return n arr = [] while n > 1:
            for i in range(2, int(2+n//2)):
                if i == (1 + n // 2):
                    arr.append(n)
                    n = n // n
                if n % i == 0:
                    arr.append(i)
                    n = n // i
                    break
        return arr
    n = 210
    print(Prime_Factorial(n))
    
    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.