Skip to main content

pymutation

Python library for calculating permutations and combinations

Example:

from pymutation import pymutation
# A reading list contains 11 novels and 5 mysteries.
books = ['N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'M', 'M', 'M', 'M', 'M']
# In how many different ways could a student select
# a. a novel or a mystery?
print(pymutation(books, [lambda x: x == 'N' or x == 'M'])) # 16
# b. a novel and then a mystery?
print(pymutation(books, ['N', 'M'])) # 55
# c. a mystery and then another mystery?
print(pymutation(books, ['M', 'M'])) # 20

Metadata

Release files for pymutation 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymutation 0.1.0
File Size Uploaded
pymutation-0.1.0.tar.gz 1.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pymutation 0.1.0
File Interpreter ABI Platform
pymutation-0.1.0-py2-none-any.whl Python 2 none any Details

Total release size: 3.8 kB

Release files / pymutation-0.1.0.tar.gz

Download URL pymutation-0.1.0.tar.gz
Size 1.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d30c7d0541cf9dfd5ded23204f2515651d69dee54e7cc454c6b4266f1e256979
BLAKE2b-256 checksum
How to use checksums
0374b3bd54227be45845eaf1cf4d45080ae1d310cf99a56c5d77d7db6077a089
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.5.4

Release files / pymutation-0.1.0-py2-none-any.whl

Download URL pymutation-0.1.0-py2-none-any.whl
Size 2.1 kB
Tags Python 2
SHA-256 checksum
How to use checksums
22e94680eac6fbd14b1df28edac3f4a1315e460cb8384a2dbc7d7e8c84455439
BLAKE2b-256 checksum
How to use checksums
5a2ff03dae95a7f248be72a2f18a2e13fe27aa24125c02ff9f7d20d35b31a82c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.5.4

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page