list index()
Marc 'BlackJack' Rintsch
bj_666 at gmx.net
Thu Aug 30 03:27:12 EDT 2007
On Thu, 30 Aug 2007 17:09:36 +1000, Ben Finney wrote:
> zzbbaadd at aol.com writes:
>
>> What's with the index() function of lists throwing an exception on not
>> found?
>
> It's letting you know that the item isn't in the list. There's no
> sensible return value from an "index" function in that condition.
What about -1? C programmers do this all the time. :-)
Ciao,
Marc 'BlackJack' Rintsch
More information about the Python-list
mailing list