For Loop in Python

Premium

In Python, we will learn about the two statements that provide explicit looping. They are for and while loops.

There are two statements that can be used to explicitly control looping. They are break and continue. The break statement causes an exit from the innermost loop that is currently being executed. The continue statement immediately causes control to return to the start of the loop. The next iteration of the loop (if there is one) is then executed. No statement below continue in the current loop is evaluated.

Unlock Premium Content

Upgrade your account to access the full article, downloads, and exercises.

You'll get access to:

  • Access complete tutorials and examples
  • Download source code and resources
  • Follow along with practical exercises
  • Get in-depth explanations