0

goto: is there a way to get python to go to a specific line and start executing code on that line? say I'm at the end of the script and want to JUMP to a specific line

5th Oct 2016, 5:33 PM
learninpython
3 odpowiedzi
+ 4
Create a function, then you can "jump" to that code whenever you need to.
5th Oct 2016, 7:29 PM
Felix
0
If you want to repeat the execution of a code, put it in a loop.
9th Oct 2016, 2:01 PM
Gershon Fosu
Gershon Fosu - avatar
0
def repeatFunction(): # here goes the part that you want to repeat. def main(): while(condition here): repeatFunction() main()
21st Nov 2016, 5:51 PM
Benedek Máté Tóth
Benedek Máté Tóth - avatar