Help me!, I would like to find split where the split sums are close to each other?

breamoreboy at gmail.com breamoreboy at gmail.com
Sun Oct 16 12:21:47 EDT 2016


On Sunday, October 16, 2016 at 12:27:00 PM UTC+1, k.ade... at gmail.com wrote:
> Help me!, I would like to find split where the split sums are close to each other?
> 
> I have a list is
> 
> test = [10,20,30,40,50,60,70,80,90,100]
> 
> ​and I would like to find split where the split sums are close to each other by number of splits = 3 that ​all possible combinations and select the split where the sum differences are smallest.
> 
> Please example code or simple code Python.
> 
> Thank you very much
> 
> K.ademarus

We do not write code for you.  I'd suggest you start here https://docs.python.org/3/library/itertools.html

Kindest regards.

Mark Lawrence.



More information about the Python-list mailing list