Python lists are ordered sequences indexed starting from 0. This zero-based indexing is standard in many programming languages and is a core concept in data structures. For the list `employees = ["Anika", "Omar", "Li", "Alex"]`, the mapping of indices to elements is: index 0 → "Anika", index 1 → "Omar", index 2 → "Li", index 3 → "Alex". Therefore, the expression `employees[3]` selects the element at index 3, which is `"Alex"`, and `print(employees[3])` outputs `Alex` (strings print without quotes in normal output).
Option A would be correct for `employees[1]`, option D would be correct for `employees[2]`, and option C would be correct for `employees[0]`. This kind of question tests understanding of list indexing, which is essential for iteration, slicing, and algorithm implementation.
# Textbooks also note the difference between indexing and slicing: indexing returns a single element, while slicing returns a sublist. Here, because square brackets contain a single integer index, it is indexing. If you attempted an index that is out of range, Python would raise an `IndexError`, which reinforces careful reasoning about list length and positions. Understanding these fundamentals is critical for correctly manipulating datasets, where row/column positions and offsets frequently matter.
Submit