PYTHON CORE · LESSON 06

Lists

A few things together · about 10 minutes

Learning with progressRead the summary for free. To save the work, log in to the account.
STEP 1

One box for many things

The list stores several values at once. Its boundaries are square brackets, and things inside are separated by commas.

pets = ["кот", "пёс"]

✦ There are two pets on the pets list.

STEP 2

You can show the whole list.

Pass the name of the list in print without quotation marks, and Python will show everything in it.

pets = ["кот", "пёс"]
print(pets)

✦ The square brackets will remain in the output.

IN-CLASS PRACTICE

Type the code yourself

Dial the list from the sample. Check the square brackets and comma.

games = ["шахматы", "мяч"]
print(games)
Open the editor for class work
HOMEWORK

Solve it yourself

Create a colors list from the words «красный», «синий», «зелёный» in that order. Bring out the whole list.

The answer is hidden. Use similar examples from the lesson notes.

Opening up your homework