Introduction

Completed

As a developer, you'll frequently work with sets of data. You might need to manage multiple names, ages, or addresses. Storing each value in an individual variable makes code harder to read and write. To store multiple values, you can use a Python list.

Scenario: Working on a planetary app

Imagine you're a developer who wants to create an application to work with a list of planets. You want to ask the user for the name of a planet and display the planets closer to and farther away from the sun.

In this module, you'll learn how to use Python lists and some of the most common operations.

What will I learn?

After completing this module, you'll be able to:

  • Identify when to use a list.
  • Create a list.
  • Access a particular item in a list by using indexes.
  • Push items to the end of a list.
  • Sort and slice a list.

What is the main objective?

By the end of this module, you'll understand when to use a list structure and how it can help organize your data.

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.