You are viewing a single comment's thread. Return to all comments →
if name == 'main': from itertools import product x = int(input()) y = int(input()) z = int(input()) n = int(input())
x_array = list(range(x + 1)) y_array = list(range(y + 1)) z_array = list(range(z + 1)) B = [x_array, y_array, z_array] all_perm = list(product(*B)) print([list(result) for result in all_perm if sum(result) != n])
Seems like cookies are disabled on this browser, please enable them to open this website
List Comprehensions
You are viewing a single comment's thread. Return to all comments →
if name == 'main': from itertools import product x = int(input()) y = int(input()) z = int(input()) n = int(input())