<br><br><div class="gmail_quote">On Jan 17, 2008 2:38 PM, Sacred Heart <<a href="mailto:scrdhrt@gmail.com">scrdhrt@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Jan 17, 1:35 pm, <a href="mailto:cokofree...@gmail.com">cokofree...@gmail.com</a> wrote:<br>> for i in zip(array1, array2):<br>>     print i<br>><br>> Although I take it you meant four d, the issue with this method is
<br>> that once you hit the end of one array the rest of the other one is<br>> ignored.<br><br></div>Yes, small typo there.<br><br>Okey, so if my array1 is has 4 elements, and array2 has 6, it won't<br>loop trough the last 2 in array2? How do I make it do that?
<br><br></blockquote></div><br>In that case, you can use map(). It pads the shortest list with None.<br><br>>>> array1 = ['one','two','three','four', 'five', 'six']
<br>>>> array2 = ['a','b','c','d']<br>>>> map(None, array1, array2)<br>[('one', 'a'), ('two', 'b'), ('three', 'c'), ('four', 'd'), ('five', None), ('six', None)]
<br><br>Quentin<br>