"list index out of range"

Hi,

What does “list index out of range” mean?

Thanks!

Jessie

Hi Jessie,
Without seeing your form I would guess that you were using a calculation feature called substr() to extract a value from another question response, similar to MID() in Excel.

Best,

Tino

···

On Wed, Mar 2, 2016 at 6:40 PM Jessie Dyer jdye...@gmail.com wrote:

Hi,

What does “list index out of range” mean?

Thanks!

Jessie

You received this message because you are subscribed to the Google Groups “Kobo Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to kobo-users+...@googlegroups.com.

To post to this group, send email to kobo-...@googlegroups.com.

Visit this group at https://groups.google.com/group/kobo-users.

For more options, visit https://groups.google.com/d/optout.

This error basically means you are trying to access a value at a List index which is out of bounds i.e greater than the last index of the list or less than the least index in the list. So the first element is 0, second is 1, so on. So if there are n elements in a python list, the last element is n-1 . If you try to access the empty or None element by pointing available index of the list, then you will get the "List index out of range " error. To solve this error, you should make sure that you’re not trying to access a non-existent item in a list.

The way Python indexing works is that it starts at 0, so the first number of your list would be [0]. Index Error: List index out of range means you are trying to get an item in a list that doesn’t exist. It means that you are referring to n-th element of the python list, while the length of the list is smaller than n. whenever you get this type of error please cross check with items that comes between/middle in range, and insure that their index is not last if you get output then you have made perfect error that mentioned.

An index in Python refers to a position within an ordered list . To retrieve an element of the list, you use the index operator ([ ]) . Using indexing you can easily get any element by its position.