Theory

Lists store multiple values in one variable.

Create a list:
fruits = ["apple", "banana", "orange"]
numbers = [1, 2, 3, 4, 5]

Access items by index (starting from 0):
print(fruits[0]) # apple
print(fruits[1]) # banana

Get list length:
print(len(fruits)) # 3

Add items:
fruits.append("grape")

Loop through list:
for fruit in fruits:
print(fruit)

Exercises in this lesson

Solve in the playground
Next lesson: Functions →