Start free

Browse › Introductory Python

Manage the Flow of Execution by Using Loops in Python

Guided

Part of Introductory Python Topic: Programming

Access

StationX Infrastructure Labs — 3 attempts per lab

🔒 Add StationX Infrastructure Labs — $149 / year · 3 attempts per lab

Already have access? Sign in.

New to this? Try a free practice lab — a scripted hacking challenge in your browser, no account needed.

What you'll do

In this lab, you will manage the flow of execution in your code by using looping structures.

  1. Iterate over a range by using a for loop
  2. Define an if statement in a for loop
  3. Stop the iteration of a for loop by using a break statement
  4. Manage the output of the for loop by using an else clause
  5. Add a return statement to a function
  6. Control the flow in a for loop by using a continue statement

Note: Once you begin the lab, you will not be able to pause, save, or exit and then return to your lab. Please ensure that you have set aside enough time to complete the lab before you start.

  • ⏱ About 30 minutes
  • Counts towards: Introduction to Python

Roadmaps that use this lab