- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Core Tech
Conditionals in Python
Build a small Python CLI for an indoor adventure park front desk. You will implement comparison helpers, simple conditional message builders, and multi-branch decision functions, then combine them into a complete visit summary for sample guests.
Lab Info
Table of Contents
-
Challenge
Step 1: Explore the starter project
You are building a small Python CLI for an indoor adventure park check-in desk. Starting from a set of placeholder functions, you will implement comparison helpers, conditional message builders, and multi-branch decision functions — then combine them into a complete visit summary for sample guests.
The project is split into focused modules:
app/comparisons.pyholds boolean helpers,app/messages.pybuilds optional summary lines,app/classification.pyhandles multi-branch logic,app/report.pycombines the results, andapp/main.pyprints the output.If you need assistance, solutions for each task can be found in the
solutionsdirectory.info > This lab experience was developed by the Pluralsight team using Forge, an internally developed AI tool utilizing Gemini technology. All sections were verified by human experts for accuracy prior to publication. For issue reporting, please contact us.
-
Challenge
Step 2: Create reusable comparison helpers
Boolean helper functions wrap a single comparison and return
TrueorFalse, giving business rules a readable name and making them easy to test. In this step, you implement three helpers inapp/comparisons.py— each returning a comparison result directly.You will:
- Implement an equality comparison (
==) - Add a minimum-height check with an inclusive operator (
>=) - Detect when a credit balance falls below a required amount (
<)
- Implement an equality comparison (
-
Challenge
Step 3: Add optional messages with simple if statements
A simple
ifblock runs its indented code only when the condition is true. When the condition is false, Python skips the block and continues — so the base output is always produced. In this step, you useifstatements to append optional lines to a guest summary inapp/messages.py.You will:
- Add a membership bonus line for members only
- Show a prize counter message when credits exceed a threshold
- Append an equipment rental note when stock is available
-
Challenge
Step 4: Build multi-branch classifications
When a program must select exactly one result from several categories, an
if/elif/elsechain evaluates conditions in order and runs only the first matching branch. Branch order and boundary operators determine which category each input receives. In this step, you implement three classifiers inapp/classification.py.You will:
- Classify guests into climbing zones by height
- Assign ticket bands by age range
- Report locker availability across three distinct states
-
Challenge
Step 5: Integrate the helpers into a working CLI
app/report.pyimports the helpers from earlier steps and assembles their output into a single multi-line summary.app/main.pyloops through sample guests and prints each summary. In this step, you complete both files to produce a working end-to-end CLI.You will:
- Combine all helpers into a single visit summary function
- Loop through sample guests and print formatted output with separators between them
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.