d return item at index (default last).
           Raise IndexError if list is empty or index is out of range.
        r