Perfect Number Code

    0

    1

    CrypticSai-08

    n = 28
    sump = 0
    for i in range(1, n):
        if(n % i == 0):
            sump= sump + i
    if (sump == n):
        print("The number is a Perfect number")
    else:
        print("The number is not a Perfect number")
    
    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.