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

Potion Pairing in Python

Build a beginner-friendly Python command-line app that evaluates potion ingredient pairings. You will implement input normalization, condition-based outcome rules, validation, and a small import-driven random selection flow while keeping the game logic separated from the CLI entry point.

Lab platform
Lab Info
Level
Beginner
Last updated
Jun 01, 2026
Duration
45m

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

    Introduction

    In this lab, you will build a small Python command-line application that evaluates ingredient pairings for a potion workshop. The project is intentionally compact so you can focus on core language skills: comparing strings, writing if and elif branches, validating input, and importing a standard-library module to add dynamic behavior. 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

    Build the foundational data and input cleanup

    This step establishes the shared data and text-cleaning behavior that the rest of the application depends on. Before conditionals can work reliably, the program needs a stable list of supported choices and a consistent way to interpret user input.

  3. Challenge

    Turn comparisons into potion rules

    This step is where the core decision-making logic comes to life. You will write focused helper functions that compare ingredients, detect special pairings, and convert those checks into the final outcome message shown to the user.

  4. Challenge

    Add validation, imports, and output formatting

    This step makes the application feel more realistic. You will guard against unsupported input, import Python's random module for dynamic behavior, and add a formatting helper so the round output is easier to read.

  5. Challenge

    Complete the round flow and run the CLI

    This final hands-on step connects all the pieces you have built so far into a complete user experience. You will assemble a single round from normalized input through final messaging, then wire that flow into the main function so the application can run from the Terminal tab. Once you've finished the tasks, it's time to test your work!

    In the Terminal, run the game with the following command:

    python3 -m app.brew_game
    

    When prompted, enter one of the supported ingredients:

    Choose herb, crystal, or mushroom:
    

    For example:

    Choose herb, crystal, or mushroom: herb
    Cauldron base: crystal
    Your ingredient: herb
    The mixture fizzles.
    
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