Saltar a contenido

Chapter 8: Lists and Tuples

Lists and tuples are used to store collections of items.

Lists

Python
fruits = ["apple", "banana", "cherry"]

Tuples

Python
dimensions = (1920, 1080)

Lists are mutable (you can change them), while tuples are immutable (you can't change them).