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
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
how to break a loop in python
x = 0
while True:
x += 1
if x == 10:
break
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us