<br>say, if I have a list l = [1,2,3,5]<br><br>and another tuple t = ('r', 'g', 'b')<br><br>Suppose I iterate over list l, and t at the same time, if I use the zip function as in zip(l,t) , I will not be able to cover elements 3 and 5 in list l<br><br>&gt;&gt;&gt; l = [1,2,3,5]<br>&gt;&gt;&gt; t = ('r', 'g', 'b')<br>&gt;&gt;&gt; for i in zip(l,t):<br>... &nbsp;&nbsp;&nbsp; print i<br>... &nbsp;&nbsp;&nbsp; <br>(1, 'r')<br>(2, 'g')<br>(3, 'b')<br><br>is there an elegant way in python to print all the elements in l, while looping over list t, if len(t) != len(l) as to get the output:<br><br>(1, 'r')<br> (2, 'g')<br> (3, 'b')<br>(5, 'r')<br><br>I could iterate over l only and reset the index to point to the first element of t, in case the elements in t are "exhausted" . Any pythonic way to iterate over a sequence, while iterating over another shorter sequence continously (granted that the lengths of the two lists are different)?<br><br><br>-iyer<p>&#32;
      <hr size=1>Fussy? Opinionated? Impossible to please? Perfect.  <a href="http://us.rd.yahoo.com/evt=48516/*http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 ">Join Yahoo!'s user panel</a> and lay it on us.