Learn

When we start writing more complex programs, we’ll start working with more pieces of data. But data can get messy real fast if we’re not careful.

To keep our data tidy, we’ll want to use data structures. Data structures are formats that we can use to keep track of our data in an organized fashion. Lists are one very basic data structure. Programmers use lists as a container to store multiple pieces of information that relate to each other in some way. Like:

  • Presidents of the US
  • Types of cheeses in alphabetical order
  • Finishing positions of runners in a race.

What makes lists special is that they order our data in a specific, linear sequence.

Since our values are kept in order, lists allow us to easily find the information we’re looking for; otherwise, we’d have a huge jumbled mess of data!

In this lesson, we’re going to cover:

  • Accessing an item from a list
  • Adding an item to a list
  • Removing an item from a list

Instructions

The exercises in this lesson will be all about making the list on the left-hand side match the list on the right-hand side.

For this exercise, use the Set List Values command and the color parameters to make the colors match!

Solution
Set List Values Red Blue Yellow Pink

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?