Untitled
unknown
python
a year ago
735 B
4
Indexable
numbers = [13, 14, 18, 19, 20, 37, 46, 47, 48, 55, 56, 57, 62, 66, 68, 72, 73, 78, 80, 86, 88, 90, 94, 104, 108, 110, 113, 114, 116, 117, 124, 129, 131, 134, 136, 137, 145, 148, 150, 156, 161, 170, 180, 184, 201, 202, 206, 209, 212, 213, 232, 256, 258, 270, 286, 298, 302, 305, 306, 308, 312, 319, 336, 351, 409, 489, 490, 500, 514, 526, 550, 551, 573, 630, 662] size = len(numbers) temp_list = [] def print_list(start, temp_addition): if temp_addition == 666: print(*temp_list) return if temp_addition > 666: return for i in range(start, size): temp_list.append(numbers[i]) print_list(i + 1, temp_addition + numbers[i]) temp_list.pop() print_list(0,0)
Editor is loading...
Leave a Comment