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

Data Types and I/O in Python

In this lab, you will finish a small Python command-line project that teaches variables, arithmetic, data types, conversion, and basic input/output. You will implement the same kinds of examples introduced in the lesson: a rectangle area calculation, int versus float detection, and an age-in-decades calculator that turns user input into formatted output.

Lab platform
Lab Info
Level
Beginner
Last updated
Jun 10, 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

    Explore the starter Python CLI project

    Welcome to the lab. You are going to complete a small Python command-line application that closely follows the teaching flow from the lesson: start with variables, perform simple arithmetic, understand int and float, convert between text and numbers, and finally build an interactive age-in-decades script. 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

    Use variables and arithmetic

    This step focuses on the first ideas introduced in the lesson: variables and arithmetic. Before a program can ask the user for input or print a polished message, it has to store values and compute with them.

  3. Challenge

    Work with int, float, and conversion

    In this step, you will use the rectangle example to introduce Python's numeric data types. This step builds that same bridge by helping the project recognize whole numbers versus decimals and by preparing text input for later math.

  4. Challenge

    Build the age-in-decades workflow

    This step assembles the central program featured in the lesson: the age-in-decades calculator. Up to this point, you have worked on the pieces independently so each concept stayed clear.

  5. Challenge

    Connect the demo and the script menu

    The final step turns the project into a cohesive learning tool. The lesson begins with a shell demonstration and then moves into a longer script, so your finished application should support both experiences. ### Run the Application

    Now that you've completed all of the functions, it's time to run the program and verify that everything works together.

    In the Terminal tab, run the application:

    python3 main.py
    

    You should see a menu similar to:

    Python Foundations Demo
    1. Shell-style variables and types demo
    2. Age in decades calculator
    Choose an option:
    

    Test both menu options:

    1. Enter 1 to view the variables, calculations, and type demonstrations.
    2. Enter 2 to calculate an age in decades and remaining years.
      • Try a few different inputs:
        • A valid age, such as 42
        • An age with surrounding spaces, such as 42
        • An invalid value, such as abc
        • A negative age, such as -5

    Confirm that: The shell demo displays the rectangle information and type examples. The age calculator displays the correct decades and remaining years.

    Invalid input shows the message:

    Please enter a whole number age.
    

    If everything works as expected, you've successfully completed the Python Foundations demo project and connected all of the helper functions into a working application.

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