index(x)
Tom
llafba at gmx.net
Thu Jun 12 10:31:47 EDT 2003
More information about the Python-list mailing list
Thu Jun 12 10:31:47 EDT 2003
- Previous message (by thread): pythonCOM with Flash
- Next message (by thread): index(x)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Thomas, thanks for your code. It works perfectly for my purposes. Yes, I did read the tutorial, but your hint to check out the cookbook was exactly what I was looking for! Thank you. Regards, Tom Thomas Güttler wrote: >Tom wrote: > >>Hi, >> >>I compare all items in a list with another value. There are always >>multiple matches. I need the list index of every match. But if I use >>index(x) it only returns the first match in that list. There is probably >>a similar command that does exactly what I want, but I can't find it. >> >> > >I would do it like this: >s="..a....a...a.a" >indexes=[] >for i in range(len(s)): > char=s[i] > if char=="a": > indexes.append(i) >print indexes > > > >>Talking about that: is there any good online help or something like >>that? I have the Python Library Reference, but I find that rather >>confusing and with very short explanations. I think they set it up the >>wrong way, because you already have to know the command you are actually >>looking for?! If I want to do something, I want to know which command I >>can use! So, is there any online help or something you can recommend? >> >> > >Did you read the tutorial? If you did and you need some more example code >have a look at the python cookbook. > > thomas > > > > >
- Previous message (by thread): pythonCOM with Flash
- Next message (by thread): index(x)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list