[Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-08 Thread John Joseph
Hi All I am trying to find out the duplicates in a list , as for beginning I wanted to compare the adjacent elements in list , for this purpose I wrote a script for checking the adjacent elements in a list, if same , it prints the result that , the adjacent numbers are same , it not it wi

Re: [Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-08 Thread Guillermo Fernandez Castellanos
Hi, Look at this: >>> i=[1,2,3] >>> i[len(i)] Traceback (most recent call last): File "", line 1, in ? IndexError: list index out of range This means that I have tried to access an element that is out of the list, in this case i[3], that is, the 4th element of the list. You are doing the

Re: [Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-08 Thread John Joseph
--- Guillermo Fernandez Castellanos <[EMAIL PROTECTED]> wrote: > Hi, > > Look at this: > >>> i=[1,2,3] > >>> i[len(i)] > Traceback (most recent call last): >File "", line 1, in ? > IndexError: list index out of range > > > This means that I have tried to access an element > that is out o

Re: [Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-08 Thread Brian van den Broek
John Joseph said unto the world upon 08/01/06 06:36 AM: > --- Guillermo Fernandez Castellanos > <[EMAIL PROTECTED]> wrote: > > >>Hi, >> >>Look at this: >> >>> i=[1,2,3] >> >>> i[len(i)] >>Traceback (most recent call last): >> File "", line 1, in ? >>IndexError: list index out of range >> >> >>T

Re: [Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-09 Thread John Joseph
Hi Brian It was a excellent tutorial, Thanks a lot for the advice I got my concepts of def of functions , sort functions , count , cleared for me I was able to do and understand all the function example , except “item_comparison” function I get the er

Re: [Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-09 Thread Brian van den Broek
John Joseph said unto the world upon 09/01/06 03:47 AM: > Hi Brian > It was a excellent tutorial, Thanks a > lot for the advice I got my concepts of def of > functions , sort functions , count , cleared for me >I was able to do and understand all the > function

Re: [Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-09 Thread Kent Johnson
Brian van den Broek wrote: > Your python is a version before set was a built-in type (2.4, I > believe). So, the iteration_comparison *and* dupe_detector_5 functions > won't work for you. > > 2.3 did include the sets module, though. > > So, stick > > from sets import set > > at the top of the

Re: [Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-09 Thread Danny Yoo
> lot for the advice I got my concepts of def of functions , sort > functions , count , cleared for me >I was able to do and understand all the > function example , except �item_comparison� function >I get the error for set > >>> set((1,1,1,2,2,2,2,2,3,4,4,5)) > Trac

Re: [Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-14 Thread John Joseph
--- Danny Yoo <[EMAIL PROTECTED]> wrote: > >I get the error for set > > >>> set((1,1,1,2,2,2,2,2,3,4,4,5)) > > Traceback (most recent call last): > > File "", line 1, in ? > > NameError: name 'set' is not defined > > Hi John, > > For Python 2.3.4, you'll need to add the line: >