Back Navigation Next Navigation Conceptual Review (page 35 of 55)

TuplesTuples can store items (elements) with mixed data types. For instance, the first indexed position may be an integer, the second indexed position may be a string, and so on. This behavior is no different from lists.

TuplesTuples are zero-based similar to lists, so the first item is in the 0th index position. To extract the items in a tuple, we use the index position in hard brackets. We may reference a single index position or multiple index positions in the hard brackets. Again, this behavior is similar to lists, which means we do not have to remember different methods if our collection object is a list or a tuple.