Python Tutorial · Revision notes
Python Tuples
A tuple is an ordered, immutable collection. You will learn how to create tuples, pack and unpack them, slice them, and use their two methods count() and index().
Quick revision
- Tuple: ordered, immutable, ( )
- Comma creates tuple: (5,)
- Only count() and index()
- sorted(t) returns a list
- Hashable if all items hashable