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
|
1827 Discussions
|
Please Login in order to post a comment
if name == 'main':
if name == 'main': x = int(input()) y = int(input()) z = int(input()) n = int(input()) l = [[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(l)
Hackerrank is the best platform. The discussions help deepen understanding—perfect for beginners and those brushing up their skills. Dentist Saskatoon
if name == 'main': x = int(input()) y = int(input()) z = int(input()) n = int(input())
for i1 in range(x+1): for i2 in range(y+1): for i3 in range(z+1):
if i1+i2+i3!=n: list.append([i1,i2,i3]) list=[ i for i in list if sum(i)!=n]
what is the mistake in here?