Introduction

Completed

You'll frequently need to work with more complex data than strings and Boolean values. This module provides you with tools for doing so. Let's frame the subject by considering a scenario.

Scenario: Analyzing a solar system

Suppose you're creating a program to analyze the number of moons on different planets in the solar system. You want to display information to the user and be able to calculate different values, like the total number of moons in the solar system. It would be tedious to do this calculation with variables, which can only store a string, or a number.

In this module, you'll build a program that can perform these types of operations. You'll use Python dictionaries to model the data. By the end of the module, you'll be able to use Python dictionaries to store complex data.

What will I learn?

In this module, you'll be able to:

  • Identify when to use a dictionary.
  • Create and modify data inside a dictionary.
  • Use dictionary methods to access dictionary data.

What is the main objective?

Use a dictionary structure within your app to store data in a format that makes it easy to look up values.

Prerequisites

You should be familiar with the concept of programming.

You don't need to install Python to complete this module. You'll use an interactive sandbox to complete the exercises.

If you want to try out the code in the explanations, you might want to work through Get started with Python in Visual Studio Code first, if you haven't already. This module helps you prepare a Python environment.