0
Can I use goto statement in python. If not then is there any equivalent for it in python?
3 Respostas
+ 3
Python doesn't have a goto because it "doesn't want to have more than one way of doing things" (which also explains why it doesn't have switch/ case).
You don't need a goto (goto is deemed as a bad habit).
You just have to restructure the program's flow.
+ 1
you can use recursive function
0
Earlier versions had a goto though:
from goto import goto, label
while True:
if C:
goto .SampleLabelName
label .SampleLabelName