Justin Ezequiel schrieb:
>>>> a = list('asdfg')
>>>> map(None, a[::2], a[1::2])
> [('a', 's'), ('d', 'f'), ('g', None)]
>>>> a = list('asdfgh')
>>>> map(None, a[::2], a[1::2])
> [('a', 's'), ('d', 'f'), ('g', 'h')]

That's clever! Thanks!

Chris
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to