How to exit the loop and immediately start it again python?

I need to get out of the cycle provided, and immediately start the cycle again. Is this possible?
April 7th 20 at 10:45
5 answers
April 7th 20 at 10:47
Solution
Rumor has it that there is such thingy in Python but I can not Google and don't like to read so XS
Here's what to Google:
How to exit the loop and immediately start it again python?
- liana_Huels commented on April 7th 20 at 10:50
@liana_Huels, naturally, I googled it before writing the question. Break will not work, it just throw it in and cycle. And I after discarding, it is necessary to begin - haven.Wyman commented on April 7th 20 at 10:53
@haven.Wyman, ........ why bother to write something in python with this approach ?
The continue statement
The continue statement starts the next pass through the loop, bypassing the remaining body of the loop (for or while)


It is in any book, article, python documentation - liana_Huels commented on April 7th 20 at 10:56
while true
 while true
 if <something>:
 break
- Cristobal commented on April 7th 20 at 10:59
@liana_Huels, damn, I forgot, thanks - haven.Wyman commented on April 7th 20 at 11:02
@haven.Wyman, you're not gonna believe this, but the cycles can be used in other cycles. - Shaniya.Koepp commented on April 7th 20 at 11:05
Read, been a long time, not immediately remembered - haven.Wyman commented on April 7th 20 at 11:08
@Shaniya.Koepp, I know, but I don't have to - haven.Wyman commented on April 7th 20 at 11:11
April 7th 20 at 10:49
I'm new, can use continue?
Yes, it helped - haven.Wyman commented on April 7th 20 at 10:52
April 7th 20 at 10:51
def function (args) : # - call a function with the loop
while True: # - the beginning of the cycle
# what you wanted to do
if (your condition):
break # stops the loop
function (args) # - call the function again and again fall into the cycle
You can reach the maximum recursion depth - shana.Bernhard87 commented on April 7th 20 at 10:54
@shana.Bernhard87, well, Yes, but it seems this is what he wants - Shaniya.Lak commented on April 7th 20 at 10:57
April 7th 20 at 10:53
from import my_func my_func

while True: #infinite loop

____if my_condition==True:#the condition:
________my_func()#exit the cycle, want back, want not, want to re-start the cycle
________#or a=my_func() ; that will bring in a cycle
________#or my_func(a) ;something Vashem a
________#or b=my_func(a);both

____#do something
____continue
April 7th 20 at 10:55
while True:
while True:
do:
if : break

Find more questions by tags Python