How to Loop Back to Previous Codes in Python

When you are processing a linear code block in Python, you may want to set up conditions that, when triggered, will cause your program to loop back and re-run a previous portion of the code. This is accomplished with code identifiers that help you form loops in linear code blocks. By identifying different sections of your program with code identifiers, you can accomplish this loop-back with relative ease.

Instructions

    • 1

      Open the Python program you are working on in your editor of choice.

    • 2

      Move your cursor to the line in the code to which you want to loop back.

    • 3

      Write down or remember that particular line number.

    • 4

      Move to the section of the code where you want to initiate the loop back.

    • 5

      Type "GOTO:xxx" where "xxx" is the line number to which you want to loop back.

Related Searches:

Comments

Related Ads

Featured