I am Prime

    0

    0

    Mahendra Kumar

    beginnerbasicMathslogic

    Python Program to Check whether the given number is a Prime Number or not

    # take inputs
    num = int(input('Enter a number: '))
    # If number is greater than 1
    if num > 1:
        for i in range(2, num//2):
            if (num % i) == 0:
                print(num, "is not a prime number")
                break
        else:
            print(num, "is a prime number")
    else:
        print(num, "is not a prime 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.