This is a function that uses the trial division algorithim to determine the primality of a given number.
On your terminal run the following command
git clone https://github.com/andela-gathondu/Prime-Numbers.git
You should have python installed in your machine. If you dont have python installed go to this link Installing Python.
You should also have pytest installed if not follow this link Installing pytest.
-
Open your terminal and go to the directory where you have the project cloned.
-
On the terminal run this command
pytest -v
and you should notice that all defined tests pass and an outputas follows should appear.
-
To try out the program on the console, got tp the terminal still inside the projects' folder and
follow the process below.
-
type
python
on the and hitenter
key and the following will be displayed depending on your python installation -
from there import the
Prime
class using this commandfrom prime import Prime
-
Now you can create an instance of the class and use the
primeNumbers()
method to get a list of the prime Numbers as shown below.
-