A prime number is a natural number greater than 1 that is not a product of two smaller natural numbers.
The script returns True if the number is prime, if the number is composite, the script prints the prime factorization of the number.
This script is ready to use script which uses one arguments to run. The argument is the integer passed for the check.
This script require the math, doctest and sys package.
$ git clone https://github.com/StokicDusan/PrimeCheck.git
$ cd PrimeCheck/
In the command line simply invoke the script with one argument:
$ python3 primeCheck.py argv1
- argv1:
Any positive integer
Invoking the script with no arguments will run testmod().
The following code block shows examples of calling the primeCheck script from terminal.
$ python3 primeCheck.py 1
1 =
$ python3 primeCheck.py 7
True
$ python3 primeCheck.py 496
496 = 2^4 * 31
$ python3 primeCheck.py 3003
3003 = 3 * 7 * 11 * 13
$ python3 primeCheck.py 304517
True
If you encounter any bugs or have suggestions, please file an issue in the Issues section of the project.