Editor

Create a List and Print Its Length

Beginner · Write the code · from Python Lists: Create, Access, Modify, and Loop Through Lists

From the lesson: Python Lists: Create, Access, Modify, and Loop Through Lists

Think about your favorite music playlist. It has a bunch of songs stored in a specific order. You can add new songs, remove old ones, rearrange them, or skip to song number five.

Read the lesson

Create a list called animals containing these three strings: "cat", "dog", "rabbit".

Then print the length of the list in this exact format:

3
# Create your list
# Print the length

More Lists exercises

All Python exercises · 50 practice problems · Data Structures quiz