Skip to content

Python script for checking if a number is prime. If the number is composite, the script prints the prime factorization of the number.

License

Notifications You must be signed in to change notification settings

StokicDusan/PrimeCheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Commit-activity Issues Repo-size License
Forks LinkedIn

Welcome to PrimeCheck !!!

A prime number is a natural number greater than 1 that is not a product of two smaller natural numbers.

What does the script do?

The script returns True if the number is prime, if the number is composite, the script prints the prime factorization of the number.

primeCheck.py :

This script is ready to use script which uses one arguments to run. The argument is the integer passed for the check.

Installing the dependencies

Used packages

This script require the math, doctest and sys package.

How to use it

1. Clone this repository:

$ git clone https://github.com/StokicDusan/PrimeCheck.git
$ cd PrimeCheck/

2. Launch:

In the command line simply invoke the script with one argument:

$ python3 primeCheck.py argv1
  • argv1:
    Any positive integer

⚠️ Note: Other input will result in an error

Invoking the script with no arguments will run testmod().

Examples

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

Provide Feedback 👍

If you encounter any bugs or have suggestions, please file an issue in the Issues section of the project.

About

Python script for checking if a number is prime. If the number is composite, the script prints the prime factorization of the number.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages