- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Core Tech
Weekly Reading Summary in Python
Build a small Python command-line application that turns a week's reading log into a structured summary report. Along the way, you will practice list creation, loop-based totals, built-in aggregation, output formatting, and simple multi-function program composition.
Lab Info
Table of Contents
-
Challenge
Introduction
Welcome to the lab! You will build a small Python command-line application that summarizes a week's reading activity from a list of page counts. 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. -
Challenge
Create the input data and first totals
This step establishes the core data flow for the entire application. Before a report can be generated, the program needs an ordered list of page counts and a reliable way to aggregate those numbers.
-
Challenge
Add built-in aggregation and supporting metrics
Now that the project has a solid manual total, this step expands the summary with additional numeric helpers. You will add the built-in
sum()approach, compute an average, and count how many days had any reading at all. -
Challenge
Turn calculations into a readable weekly report
This step moves from isolated numbers into presentation-oriented structure. A strong report usually mixes summary metrics with contextual detail, so you will identify the best reading day, generate one line per day, and assemble the full multi-line report text.
-
Challenge
Integrate the final checks and run the CLI
The last step focuses on integration. You already have the core calculations and the finished report builder, so now the goal is to connect those pieces into a polished command-line program. Once you've finished the tasks, it's time to see everything come together!
In the Terminal, run the application with the following command:
python3 -m app.mainThe program will generate a weekly reading report and display a quick totals check at the end.
Example output:
Weekly Reading Report ===================== Days logged: 7 Reading days: 6 Total pages (loop): 122 Total pages (sum): 122 Average pages: 17.4 Best day: Thursday (30 pages) Daily entries: - Monday: 18 pages - Tuesday: 0 pages - Wednesday: 24 pages - Thursday: 30 pages - Friday: 12 pages - Saturday: 16 pages - Sunday: 22 pages Check complete: both totals match.
About the author
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.