Skip to main content

Basically only a function to iterate through tuples and add their values. Example: (1,2)+(2,3)=(3,5)

Project description

The function flatten(*argv) takes an arbitrary amount of tuples and returns the sum of of each indices’ value. The tuples should have the same length.
>>> from tuple_flatten import flatten
>>> flatten((1, 5), (2, 7))
(3, 12)::
It is not necessary for all tuples to be equally sized, as long as each tuple in the arguments is either shorter or equally sized as its predecessor.
>>> flatten((1, 7), (3,))
(4, 7)::

Project details

Release history Release notifications

This version


Download files

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

Files for tuple-flatten, version 1.0
Filename, size File type Python version Upload date Hashes
Filename, size tuple_flatten-1.0-py3-none-any.whl (2.0 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size tuple_flatten-1.0.tar.gz (1.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page