I'm really confused now:
>>> string = "some string"
>>> string[100:105]
''
>>> string[100]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IndexError: string index out of range
Why does string[100:105]
return an empty string whereas string[100]
raises an IndexError (as expected)? Why does string[100:105]
not raise an IndexError as well?