An indexable type accepts either a single integer index or a slice. In Python, one function can therefore operate across strings, lists, and tuples instead of duplicating logic for each type. section 4.5
Process the final elements
Use a slice to select the last n values, then iterate over the result: mylist[-n:]. The same pattern applies to a substring or another sequence. section 4.5
Practice with index and slice operations:
- Return the sums of the even-indexed and odd-indexed numbers in a list or tuple. section 4.5
- Alternately add and subtract values from a list or tuple. section 4.5
- Partly emulate zip while accepting indexable inputs. section 4.5

