diff --git a/recipes/Python/list comprehension.py b/recipes/Python/list comprehension.py new file mode 100644 index 000000000..666fef8a6 --- /dev/null +++ b/recipes/Python/list comprehension.py @@ -0,0 +1,14 @@ +if __name__ == '__main__': + x = int(input()) + y = int(input()) + z = int(input()) + n = int(input()) + + permuts = [ + [i, j, k] + for i in range(x + 1) + for j in range(y + 1) + for k in range(z + 1) + if i + j + k != n + ] + print(permuts)