Answers for "what is prime number in python"

1

is prime python

import math
def isPrimeNumber(n):
    if (n < 2):
        return False;
    sq = int(math.sqrt(n))
    for i in range(2, sq + 1):
        if (n % i == 0):
            return False
    return True
Posted by: Guest on October-29-2021

Python Answers by Framework

Browse Popular Code Answers by Language