Welcome to Dream.In.Code
Getting Help is Easy!

Join 135,924 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,604 people online right now. Registration is fast and FREE... Join Now!




list index out of range

 
Reply to this topicStart new topic

list index out of range

gijig
19 May, 2008 - 02:53 AM
Post #1

New D.I.C Head
*

Joined: 14 May, 2008
Posts: 5

while handling large lists,i am encountering an error message:
list index out of range.
can i know about some methods like efficient data structure ,etc to handle this problem with large lists.

the program is working properly with small lists
User is offlineProfile CardPM
+Quote Post

girasquid
RE: List Index Out Of Range
2 Jun, 2008 - 07:10 PM
Post #2

Barbarbar
Group Icon

Joined: 3 Oct, 2006
Posts: 1,264



Thanked: 14 times
Dream Kudos: 650
My Contributions
If you're getting an index out of range error, usually it means you're trying to access a part of the list that doesn't exist - like trying to access array[4] when your array is only 3 elements long.
User is offlineProfile CardPM
+Quote Post

numberwhun
RE: List Index Out Of Range
5 Jun, 2008 - 03:13 PM
Post #3

New D.I.C Head
*

Joined: 28 Mar, 2008
Posts: 8


My Contributions
QUOTE(girasquid @ 2 Jun, 2008 - 08:10 PM) *

If you're getting an index out of range error, usually it means you're trying to access a part of the list that doesn't exist - like trying to access array[4] when your array is only 3 elements long.


I fully agree with girasquid.

I don't know about python, but in Perl, you can obtain the highest populated list index by using:

perl

$#arrayname


Regards,

Jeff
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 08:14AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month