How can I get rid of multiple nested for loops?
-
29-10-2019 - |
Question
I have a Python (3.2) script that searches for points with a property that I want. But it has this ugly part:
for x in range(0,p):
for y in range(0,p):
for z in range(0,p):
for s in range(0,p):
for t in range(0,p):
for w in range(0,p):
for u in range(0,p):
if isagoodpoint(x,y,z,s,t,w,u,p):
print(x,y,z,s,t,w,u)
else:
pass
Is there something I can do so that it looks a bit better?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow