2010/3/5 Rolando Espinoza La Fuente <dark...@gmail.com>:
[...]
>        diff = []
>
>        for j in range(max(len(a), len(b))):
>            if not getitem(a, j) == getitem(b, j):
>                diff.append(j)

Esto se podría simplificar a

        diff = [j for j in range(max(len(a), len(b)))
                if not getitem(a, j) == getitem(b, j)]

Rolando
_______________________________________________
Python-es mailing list
Python-es@python.org
http://mail.python.org/mailman/listinfo/python-es
FAQ: http://python-es-faq.wikidot.com/

Responder a