Ask coding questions

← Back to all posts
Is there a way to have the program execution go back to the beginning?
TheFlooBearer (2)

In my code, it would be helpful to have the program execution go to the beginning of the program. Once the program execution reaches the bottom of the code, (Line 81) I'd like it to go back to line 1. Is there a function that can do this? I have heard of the continue statement, but that only seems to work with moving the program execution back to the beginning of the function, not the program.
I am using Python, and a Linux emulator (Default for Python in

^My code^

JustARatherRidi (190)

Whenever you need to repeat blocks of code, think of loops. If you want to execute all of the code repeatedly, just put the whole thing inside a loop :)

Working code:

TheFlooBearer (2)

@JustARatherRidi Thanks a Million! I'll remember this

JustARatherRidi (190)

@TheFlooBearer Anytime! If I solved your problem, could you mark my answer correct?