Iterating two arrays at once

mathieu mathieu.malaterre at gmail.com
Fri Aug 29 06:35:51 EDT 2008


Hi there,

  just trying to figure out how to iterate over two array without
computing the len of the array:

  A = [1,2,3]
  B = [4,5,6]
  for a,b in A,B: # does not work !
    print a,b

It should print:

  1,4
  2,5
  3,6

Thanks !



More information about the Python-list mailing list