0
Python : Breaking nested loop
For you, what is the most elegant manner to break the nested loop, with 2 levels deep or more ? Many thanks for your time regards EG
1 Answer
+ 1
for x in range(10):
for y in range(10):
for z in range(10):
print(x,y,z)
if x*y*z == 30:
break
else:
continue
break
else:
continue
break