resultList = [] for a in xrange(1,98): for b in xrange(1,98): for c in xrange(1,98): d = 100 - a - b - c if d > 0 and a <= b <= c <= d: resultList.append([a,b,c,d]) print len(resultList) print resultList[:10] print ". . . 7133 list items elided . . ." print resultList[-10:]
Standard input is empty
7153 [[1, 1, 1, 97], [1, 1, 2, 96], [1, 1, 3, 95], [1, 1, 4, 94], [1, 1, 5, 93], [1, 1, 6, 92], [1, 1, 7, 91], [1, 1, 8, 90], [1, 1, 9, 89], [1, 1, 10, 88]] . . . 7133 list items elided . . . [[23, 24, 24, 29], [23, 24, 25, 28], [23, 24, 26, 27], [23, 25, 25, 27], [23, 25, 26, 26], [24, 24, 24, 28], [24, 24, 25, 27], [24, 24, 26, 26], [24, 25, 25, 26], [25, 25, 25, 25]]