From c53ed3905c9bfa4bd76a0e414cc4654abc318144 Mon Sep 17 00:00:00 2001 From: Tushar Takshak <66051224+trixtun@users.noreply.github.com> Date: Fri, 2 Oct 2020 11:54:21 +0530 Subject: [PATCH] Add files via upload --- recipes/Python/list comprehension.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 recipes/Python/list comprehension.py 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)