Module 4: Data Collections and Functions
Tuples
Tuples are ordered, immutable (unchangeable) collections of items. Defined using parentheses ()
.
Example: my_tuple = (1, "apple", True)
Once created, you cannot change, add, or remove items. They are often used for fixed collections of items, like coordinates (x, y)
. Accessing items is similar to lists (using index).