Answers for "python break all loops"

1

break all loops

break only stops the loop it is in.
if you want to break out of a while true loop try:
flag = True
while flag:
	for i in range(1000):
    	if i == 10:
        	flag = False
            break
Posted by: Guest on May-15-2021
1

how to break a loop in python

x = 0
while True:
    x += 1
    if x == 10:
        break
Posted by: Guest on April-30-2020

Python Answers by Framework

Browse Popular Code Answers by Language