Tutorial
Tuples in Python
A tuple in Python is an ordered collection of items, similar to a list, but it is immutable. This means once a tuple is created, its items cannot be changed.
Creating Tuples
Accessing Tuple Items
Tuple Operations
Summary
- Tuples are ordered and immutable sequences.
- You can access items using indexes, including negative indexes.
- Use
len(tuple)to get the number of items. - You can concatenate tuples to create a new tuple, but cannot modify the original.