What happens when Python evaluates "abc"[4]?
Explanation
The string has valid nonnegative positions 0 through 2, so direct access at 4 raises IndexError. Direct indexing does not clip an excessive position or return None as a sentinel.
The string has valid nonnegative positions 0 through 2, so direct access at 4 raises IndexError. Direct indexing does not clip an excessive position or return None as a sentinel.