Featured resource
2026 Tech Forecast
2026 Tech Forecast

1,500+ tech insiders, business leaders, and Pluralsight Authors share their predictions on what’s shifting fastest and how to stay ahead.

Download the forecast
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Core Tech
Labs

Loops and Range in Python

Build a command-line Reading Sprint Tracker that asks a user how many reading sprints they completed, records pages read in each sprint, and prints a readable summary. Along the way, you will practice Python for-loops with range(), including default and custom start-stop-step forms, and reinforce list building, aggregation, and test-driven development.

Lab platform
Lab Info
Level
Beginner
Last updated
Jun 09, 2026
Duration
30m

Contact sales

By clicking submit, you agree to our Privacy Policy and Terms of Use, and consent to receive marketing emails from Pluralsight.
Table of Contents
  1. Challenge

    Step 1: Explore the project and the learning path

    In this lab, you will build a small Python command-line application that tracks pages read across a series of reading sprints. The project is intentionally simple on the surface so you can focus on one of the most important building blocks in the language: repeating work a specific number of times with for loops and range().

    If you get stuck, you can refer to the provided solution code for each task, available in the solution folder.

    info> This lab experience was developed by the Pluralsight team using an internally developed AI tool. All sections were verified by human experts for accuracy prior to publications. However, content may still contain errors or inaccuracies, and we recommend independent verification. To report a problem or provide feedback, click here. Feedback may be used to improve accuracy in accordance with our Privacy Policy.

  2. Challenge

    Step 2: Build the foundational range helpers

    This step focuses on the most basic and most common use of range(): creating predictable sequences of numbers for loops and helper functions. Before the application can ask the user for repeated input, it needs clear rules for how sprint positions are represented internally and how they are displayed to the user.

  3. Challenge

    Step 3: Use loops to collect repeated input and labels

    This step turns sequence helpers into actual application behavior. Instead of working with isolated number lists, you will now use them to control how many times the program prompts the user and to build data structures that represent a reading session.

  4. Challenge

    Step 4: Customize range() with start, stop, and step

    This step moves beyond the default counting pattern and explores how the third argument to range() changes a sequence. In practical applications, stepped ranges let you sample every nth record, highlight milestone intervals, or split positions into categories such as odd and even entries.

  5. Challenge

    Step 5: Summarize the session and run the CLI

    This final implementation step combines everything you have built so far into a working command-line experience. The data has already been collected; now you will aggregate it, format it, and expose it through one entry-point function. In your Terminal, run python main.py. The program will prompt you for your name, then ask how many reading sprints you completed, and then ask for the number of pages you read in each sprint one at a time. Once you've entered all your data, it will print a reading summary showing your sprint labels, total pages, average pages per sprint, which sprints fell on even numbers, and which sprints hit a checkpoint interval. Give it a try with 3–5 sprints to see everything in action.

About the author

Pluralsight’s AI authoring technology is designed to accelerate the creation of hands-on, technical learning experiences. Serving as a first-pass content generator, it produces structured lab drafts aligned to learning objectives defined by Pluralsight’s Curriculum team. Each lab is then enhanced by our Content team, who configure the environments, refine instructions, and conduct rigorous technical and quality reviews. The result is a collaboration between artificial intelligence and human expertise, where AI supports scale and efficiency, and Pluralsight experts ensure accuracy, relevance, and instructional quality, helping learners build practical skills with confidence.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight