GithubHelp home page GithubHelp logo

stokicdusan / primecheck Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 29 KB

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

License: MIT License

Python 100.00%
python python3 python-script prime-numbers recreational-mathematics

primecheck's Introduction

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.

primecheck's People

Contributors

stokicdusan avatar

Stargazers

 avatar  avatar

Watchers

 avatar

primecheck's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.