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

Nested Data and JSON in Python

Complete a Python starter project for a city trip planner using nested lists, dictionaries, and JSON serialization.

Lab platform
Lab Info
Level
Beginner
Last updated
Jun 16, 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 City Explorer Planner starter project

    Welcome to the City Explorer Planner lab. You will complete a small Python utility that stores trip ideas, place categories, traveler records, and a final exportable snapshot.

    The planner package is split by responsibility: itinerary.py works with nested lists, categories.py uses dictionaries with list values, profiles.py models travelers as dictionaries, and snapshot.py combines everything and serializes it with the json module. The tests directory has one pytest file per task, and main.py is an entry point you can run manually. >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 and navigate the nested itinerary

    In this step you will group activity lists into a nested structure, retrieve a specific value by index, and flatten the whole collection for reporting. All three tasks live in planner/itinerary.py.

  3. Challenge

    Step 3: Organize place recommendations by category

    In this step you will store lists of place names inside a dictionary, format its contents by iterating with items(), and add a safe case-insensitive lookup. All three tasks live in planner/categories.py.

  4. Challenge

    Step 4: Model travelers with dictionaries

    In this step you will represent travelers as dictionaries, generate readable summaries from their fields, and map that formatting over a list of profiles. All three tasks live in planner/profiles.py.

  5. Challenge

    Step 5: Create the final snapshot and export it

    In this final step you will combine all planner data into one snapshot dictionary, serialize it as JSON, and compute totals from the nested structures. All three tasks live in planner/snapshot.py.

  6. Challenge

    Step 6: Run the planner

    All functions are complete. In the terminal, run:

    python main.py
    

    You should see the itinerary, category map, traveler summaries, JSON snapshot, and totals printed with no errors. Congratulations on completing the lab! In this project, you built a city trip planner that outputs a nested itinerary, formatted category listings, traveler summaries, and a serialized JSON snapshot, all printed cleanly from a single main.py entry point. Along the way, you practiced working with nested lists and dictionaries, safe index lookups, dictionary iteration with items(), and list manipulation using extend(). You also modeled real-world data as Python dictionaries, transformed collections of records into readable summaries, and used json.dumps to serialize a complex nested structure into a portable, deterministic JSON string.

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