[Tutor] List iteration

Sharriff Aina NHYTRO@compuserve.com
Fri, 11 May 2001 05:47:08 -0400


Hi guys!

I would like to do some list iteration, is there a way to do something li=
ke
this:


# code start
list_a =3D ['a', 'b', 'c']
list_b =3D ['d', 'e', 'f']

for x, y in [list_a, list_b]:
....print  x + y          # hypo, this FAILS!! since the iterators length=

is shorter than the number of elements in list_a or list_b

Any ideas?


Cheers Sharriff


P.S. got a new python book, I hope to stop irritating you guys very soon
:-))