We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
List Comprehensions
List Comprehensions
Sort by
recency
|
1745 Discussions
|
Please Login in order to post a comment
if name == 'main': x = int(input()) y = int(input()) z = int(input()) n = int(input())
from itertools import product
def get_coordinates(x: int, y: int, z: int, n: int) -> list:
if name == 'main':
result = [[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(result)
result=[ ] for i in range(x+1): for j in range(y+1): for k in range(z+1): if i+j+k!=n result.append([i,j,k]) print(result)