On Fri, Mar 5, 2010 at 11:08 AM, Olemis Lang (Simelix)
<[email protected]> wrote:
> On Fri, Mar 5, 2010 at 10:56 AM, Rolando Espinoza La Fuente
> <[email protected]> wrote:
>> On Fri, Mar 5, 2010 at 11:49 AM, Ricardo Cárdenes Medina
>> <[email protected]> wrote:
>> [...]
>>>
>>> def compare(L1, L2):
>>> if len(L1) <> len(L2):
>>> return None
>>>
>>> return [x for x,(y,z) in enumerate(zip(L1, L2)) if y <> z]
>>
>> El problema con el zip, es que te corta la lista al más corto
>>
>
> izip ?
>
{{{
#!python
>>> from itertools import izip, chain, repeat
>>> list(izip([1,2,3], chain([2,3], repeat(None))))
[(1, 2), (2, 3), (3, None)]
}}}
--
Regards,
Olemis.
Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/
Featured article:
_______________________________________________
Python-es mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-es
FAQ: http://python-es-faq.wikidot.com/