How to Check if a Number is Prime

def is_prime(number):
    if number < 2:
        return False
    for i in range(2, int(number**0.5) + 1):
        if number % i == 0:
            return False
    return True

check_number = 13
print(f"Is {check_number} a prime number? {is_prime(check_number)}")


Is 13 a prime number? True

Leave a Comment

Your email address will not be published.