Python Forum

Full Version: How to take group of numbers summed in groups of 3...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I'm very new to coding but already have a practical need. This is way over my head but I thought I'd see if someone might be interested in helping me out.

I have 48 numbers. I need to know if any combination of those numbers, arranged as a group of 3, will be equal to a set 16 other numbers +/- .02. I'd like to see output in 2 categories, exact match and within tolerance.

Any and all help appreciated, and if this is inappropriate, let me know, I'll take it down.

Thanks.
To get started, to make a combination take a look at the Combinatoric iterators of https://docs.python.org/3/library/itertools.html