Finding Factors

    0

    0

    Mahendra Kumar

    beginnerbasicMaths

    To print the factors of a given number

    # take inputs
    num = int(input('Enter number: '))
    # find factor of number
    print('The factors of', num, 'are:')
    for i in range(1, num+1):
        if(num % i) == 0:
            print(i, end=' ')
    
    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.