comparing two arrays

Maric Michaud maric at aristote.info
Tue Jun 20 06:57:33 EDT 2006


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] ]


-- 
_____________

Maric Michaud
_____________

Aristote - www.aristote.info
3 place des tapis
69004 Lyon
Tel: +33 426 880 097



More information about the Python-list mailing list