Skip to main content

No project description provided

Project description

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

Project details


Download files

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

Files for pymutation, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size pymutation-0.1.0-py2-none-any.whl (2.1 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size pymutation-0.1.0.tar.gz (1.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page