Jan-13-2021, 02:58 AM
Here is the code that is causing IndexError...
Could someone tell me why this is happening?
s = "python" print(s[8])
Output:Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IndexError: string index out of range
But this code is not occured error!Could someone tell me why this is happening?
s = "python" print(s[:8])
Output:python