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

Kent Johnson kent37 at tds.net
Mon Jan 9 21:09:05 CET 2006


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 code and it ought work.

The class name is different in 2.3 also. Use
from sets import Set as set

to get the same spelling as in 2.4.

Kent



More information about the Tutor mailing list