Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

is-prime

Write a function, is_prime, that takes in a number as an argument. The function should return a boolean indicating whether or not the given number is prime.

A prime number is a number that is only divisible by two distinct numbers: 1 and itself.

For example, 7 is a prime because it is only divisible by 1 and 7. For example, 6 is not a prime because it is divisible by 1, 2, 3, and 6.

You can assume that the input number is a positive integer.

test_00:

is_prime(2)

test_01:

is_prime(3)

test_02:

is_prime(4)

test_03:

is_prime(5)

test_04:

is_prime(6)

test_05:

is_prime(7)

test_06:

is_prime(8)

test_07:

is_prime(25)

test_08:

is_prime(31)

test_09:

is_prime(2017)

test_10:

is_prime(2048)

test_11:

is_prime(1)

test_12:

is_prime(713)