[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] array search



On Mar 27, 2004, at 4:40 PM, Derek Simkowiak wrote:

Nicolás Sanguinetti wrote:
AFAIK, no, you can only find all indexes by iterating through the array.
cheers
	In Python 2.3, you can use "enumerate".

http://www.python.org/doc/current/whatsnew/section-enumerate.html
Well "finding all indexes" is easy enough: range(len(anArray))

The problem at hand is "finding all indexes that are not 0", so you obviously do have to iterate through the whole array to find them... whether or not you explicitly use 'for' to do it.

-bob

Attachment: smime.p7s
Description: application/pkcs7-signature