Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: string index out of range
Post: RE: string index out of range

I found the following. From the python intro: Quote:Degenerate slice indices are handled gracefully: an index that is too large is replaced by the string size, an upper bound smaller than the lower b...
jade_kim General Coding Help 4 2,639 Jan-13-2021, 05:41 AM
    Thread: string index out of range
Post: RE: string index out of range

(Jan-13-2021, 03:27 AM)deanhystad Wrote: Slices are polite? What would you prefer, for the slice to give you as big a slice as it can, up to what you ask, or to raise an exception. The author pick...
jade_kim General Coding Help 4 2,639 Jan-13-2021, 04:27 AM
    Thread: string index out of range
Post: string index out of range

Here is the code that is causing IndexError... s = "python" print(s[8])Output:Traceback (most recent call last): File "<stdin>", line 1, in <module> IndexError: string index out of rang...
jade_kim General Coding Help 4 2,639 Jan-13-2021, 02:58 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020