comparing two arrays

Diez B. Roggisch deets at nospam.web.de
Tue Jun 20 07:27:21 EDT 2006


Maric Michaud wrote:

> Le Mardi 20 Juin 2006 12:09, Diez B. Roggisch a écrit :
>> [i for i, equals in enumerate((x == y for x, y in zip(a, b))) if equals]
> 
> No needs to nest comprehensions, should be :
> 
> [ i for i, v in enumerate(zip(a, b)) if v[0] == v[1] ]

You're right, that design stemmed from my first broken version.

Diez



More information about the Python-list mailing list