On May 2, 2:49 pm, Jeff <[EMAIL PROTECTED]> wrote:
> The generally used idiom for that is:
>
> lst = ['a', 'b', 'c']
> if 'a' in lst:
>   foo = lst.index('a')

Jeff - Gracias !!

I am fairly new to python. Thanks for the example code snippet above.
It is the same amount of code as receiving -1 and then checking for
doing an "if else" for -1 so now i don't feel bad. But, being new to
this paradigm, raising of an exception when it can't find the element
appears to be weird to me for some unexplainable reason.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to