1Using break in a nested loop
2
3In a nested loop, a break statement only stops the loop it is placed in.
4Therefore, if a break is placed in the inner loop, the outer loop still
5continues. However, if the break is placed in the outer loop, all of the
6looping stops.
7
8
1break only stops the loop it is in.
2if you want to break out of a while true loop try:
3flag = True
4while flag:
5 for i in range(1000):
6 if i == 10:
7 flag = False
8 break
9