← Previous Next →

Check if a number is prime

Created by Julien Palard


Define the function is_prime(n).

n is number that the function is_prime takes as a parameter.

The function is_prime return True if num is a prime number, False otherwise. Such as:

>>> from solution import is_prime
>>> is_prime(3)
>>> is_prime(4)

Your Code

Login to check your code and save your progress.