Oct-26-2018, 02:27 AM
Try this: start with two empty lists (the list of lists, and the first sub-list). Have a total that is zero.
Now loop through the numbers in the loop you were given. If the number plus the total is ten or less, append that number to the sub-list and add it to the total. Otherwise, append the sub-list to the list of lists, start a new sub-list with that number, and reset the total.
At the end of the loop you will have a sub-list left over. Append that to the list of lists. That should be that.
Now loop through the numbers in the loop you were given. If the number plus the total is ten or less, append that number to the sub-list and add it to the total. Otherwise, append the sub-list to the list of lists, start a new sub-list with that number, and reset the total.
At the end of the loop you will have a sub-list left over. Append that to the list of lists. That should be that.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures