Add the first X Pi digits
Project description
Py digits
This library was inspired by this meme:
Now we can easily solve it in less than a second!
Getting started
Install the library with:
pip install -U py-digits
Usage
from pydigits import sum_pi_digits
print(sum_pi_digits(31_415, 'odd'))
# 78662
print(sum_pi_digits(31_415, 'odd', 'binary'))
# 10011001101000110
Documentation
pi_digits
function pydigits.pi_digits(decimals)
Function that returns the pi
number rounded to the number of digits given has an argument.
Parameters
- decimals:
int
. Number of digits ofpi
requested.
sum_pi_digits
function sum_pi_digits(decimals, nature="all", notation="decimal")
Parameters
-
decimals:
int
. Number of digits ofpi
requested. -
nature:
"all"
,"even"
or"odd"
, default"all"
. The nature of the digits ofpi
taht you want to count for your sum. -
notation:
"decimal"
or"binary"
, default"decimal"
. The notation of the answer obtained.
Testing
Run the test suite with:
python -m unittest tests
Install Local
To install it locally from the source code:
python setup.py develop
Change Log
1.0.0 (15/02/2022)
- First Release
1.0.1 (15/02/2022)
- Fix missing dependencies
1.0.2 (18/02/2022)
- Add functions description documentation
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
Built Distribution
File details
Details for the file py-digits-1.0.2.tar.gz
.
File metadata
- Download URL: py-digits-1.0.2.tar.gz
- Upload date:
- Size: 78.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6fdb55ad85b7ba0c5e0b9898efa8fa68ca363fe5c78d817a6536970020529d5 |
|
MD5 | 6d51317c21f1f5161fd2020ae461e65b |
|
BLAKE2b-256 | b80786b7d48ccbaeaddfb6d1ee32df853c30615ac28577dc301354712cbc2f41 |
File details
Details for the file py_digits-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: py_digits-1.0.2-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 200fffae6f33c734fcdffedb745894a1688efe4a434c1338ac31774f3afff73a |
|
MD5 | e6ea1a9bdda50446ddcf31d204b9758b |
|
BLAKE2b-256 | 9d5cf4b56e84c4d541a578cf4e8ee25e5ade644f0772e83e5e7a281e61ea343c |