On Jan 17, 7:39 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > Sacred Heart <[EMAIL PROTECTED]> writes: > > array1 = ['one','two','three','four'] > > array2 = ['a','b','c','d'] > > > I want to loop through array1 and add elements from array2 at the end, > > so it looks like this: > > > one a > > two b > > three c > > four c > > The "functional" style is to use the zip function that someone > described. The old-fashioned way is simply: > > n = len(array1) > for i in xrange(n): > print array1[i], array2[i] > > You can modify this in various ways if the lengths of the lists are > not equal. E.g.
Thank you Paul, and everybody else contributing with answers of various complexity. Although a whole bunch of them was way too complex for my simple problem, but that's ok. I now know how to use map and zip, and also learned some tips and tricks. Thanks. All the best, SH -- http://mail.python.org/mailman/listinfo/python-list