There no way to break out of only the inner loop of a next loop in #python?
for i in range(1,100)
while True:
print("whut?")
break # what?
Conversation
Replying to
break should break out of the While loop there. Not sure what you mean?
Replying to
If you want to break out of the inner While loop, but not the outer for loop. Or if you want to break out of the outer for loop when you are in the middle of the inner loop. Other languages have features for this. stackoverflow.com/a/504983/33264
1
Replying to
for x in range(1,10):
while True:
print(x)
break
This gives me the output (1,2,3,4,5,6,7,8,9) which I would expect. It is breaking out of the inner while loop but staying in the outer for loop. What output would you expect?
1
Show replies

