Skip to content

Commit 4faa68d

Browse files
committed
using nested list comprehensions for list comprehensions problem
1 parent 94b0816 commit 4faa68d

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

DataTypes/ListComprehensions.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,4 @@
1010
y=int(raw_input())
1111
z=int(raw_input())
1212
n=int(raw_input())
13-
final_ar=[]
14-
for i in range(0,x+1):
15-
for j in range(0,y+1):
16-
for k in range(0,z+1):
17-
tmp=i+j+k
18-
if(tmp!=n):
19-
ar=[i,j,k]
20-
final_ar.append(ar)
21-
22-
print final_ar
13+
print([ [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 ])

0 commit comments

Comments
 (0)