How can i exit from inner loop ?! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How can i exit from inner loop ?!

19th Aug 2021, 6:09 PM
Raad Mousavi
Raad Mousavi - avatar
8 Answers
+ 3
return
19th Aug 2021, 6:28 PM
JaScript
JaScript - avatar
+ 4
break
19th Aug 2021, 6:16 PM
Lisa
Lisa - avatar
19th Aug 2021, 6:38 PM
Lisa
Lisa - avatar
+ 2
To stop the Loop: break To Continue Loop: continue
20th Aug 2021, 4:03 PM
Sancho Godinho
Sancho Godinho - avatar
+ 1
It only break from one layer not all of them
19th Aug 2021, 6:18 PM
Raad Mousavi
Raad Mousavi - avatar
+ 1
You should really start with basics ...
21st Aug 2021, 10:54 AM
WhitE _HAT
0
while True: while True: break else: rest of first loop continue break You should control the flow with continue so if one break goes others go with it if you want more control you should define boolean flags.
19th Aug 2021, 7:09 PM
Abs Sh
Abs Sh - avatar
0
I am at the beginning
23rd Aug 2021, 9:49 PM
Raad Mousavi
Raad Mousavi - avatar