Access Tuples
Tuple indexing and slicing work much like list indexing and slicing. The difference is that you cannot replace an item in the tuple afterward.
Understand the idea
A negative index reads from the end. A slice produces another tuple with a selected range. For a fixed record, unpacking into descriptive names often communicates more than repeated indices. Keep the record's shape documented so callers do not quietly swap meanings.
Where to try it
Open this example with Try in playground. The code loads as editable text and does not run until you select Run. The first run downloads Python. Each run starts fresh; temporary files created by a script are not files on your PC.
A worked example
booking = ("Mira", "Python", 2)
print(booking[-1])
print(booking[:2])
Read the result
The outputs are 2 and ('Mira', 'Python').
Try one change
Unpack booking into name, course, and seats, then print a labelled sentence.