list prob

Gonçalo Rodrigues op73418 at mail.telepac.pt
Tue May 21 19:42:18 EDT 2002


On Wed, 22 May 2002 00:38:15 +0100, Gonçalo Rodrigues
<op73418 at mail.telepac.pt> wrote:

>On Tue, 21 May 2002 23:48:41 +0200, "kemu" <kemusoft at hotmail.com> wrote:
>
>>I want to search a list if I do list.index("word to search") and the word
>>isn't in the list I get an error I don't want to get one from python but
>>want my own error like word is not in the list how ?
>>or is there an other way to search the list for strings and if he doesn't
>>find one he doesn't print an error ?
>>
>
>Let me add that using the find method also works. But the try block
>idiom is useful for a lot of thing and is worth learning/understanding.
>
>Best,
>Gonçalo Rodrigues

Disregard this. The find method is for strings - I was lead astray by G.
Newcomb's post - my fault :-(

Best,
Gonçalo Rodrigues



More information about the Python-list mailing list