Skip to main content

python package that gives mathematical factors of a number

Project description

py_factors

A python package that gives the mathematical factors of a number fast.

Installation

python3 -m pip install py_factors

Example

A quick example of methods you can access.

Each of the functions below have additional argument ordered except prime_factors. ordered can take value of True or False. True means give an ordered output while False means otherwise. By default it is False

   
    from py_factors import Factors

    #initialize the Factor class
    factor_init= Factors()

    # factors of 200
    fact200= factor_init.math_factors(200)
    output: [1, 200, 2, 100, 4, 50, 5, 40, 8, 25, 10, 20]
   
    #square factors of 200 i.e factors of 200 that are perfect squares.
    perf_fact200= factor_init.square_factor(200)
    output: [1, 100, 4, 25]

    #even factors of 200
    even_fact200=factor_init.even_factors(200)
    output: [200, 2, 100, 4, 50, 40, 8, 10, 20]

    #odd factors of 200
    odd_fact200 = factor_init.odd_factors(200)
    output: [1, 5, 25]

    # prime factors of 200 i.e factors of 200 that are prime numbers
    prime_fact200 = factor_init.prime_factors(200)
    output: [2, 5]   

Note

prime_factors doesn't have additional argument ordered and it also gives result in ordered form.

Setting ordered=False in the functions gives result faster than when ordered=True.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_factors-1.0.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_factors-1.0.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file py_factors-1.0.0.tar.gz.

File metadata

  • Download URL: py_factors-1.0.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for py_factors-1.0.0.tar.gz
Algorithm Hash digest
SHA256 bef580ce293688e04ec7b5f6da0bb75e0a73774bfdb25f8f21c6eaf4a48fe6c2
MD5 627b4950f0a2cfecbd2d540ac5fc5539
BLAKE2b-256 0fce2e21f74efe1acbe422ab4998fe1985956a0e8e1e156a3776712d6cce8a4c

See more details on using hashes here.

File details

Details for the file py_factors-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: py_factors-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for py_factors-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b1b8f9d8dd0c73234fe514c21508fde0874ffd9c6166dc9963e06768de84ecd
MD5 dba53bdd163d4a964e4cffecb57a5adc
BLAKE2b-256 6f085a50ded10387ed1187cfecd0e99c377d04fbacb2ccf6e40171ae0cf18727

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page