<div dir="ltr">Thanks Gary. <div class="gmail_extra"><br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">
<div><div class="h5"><blockquote type="cite"><br>
    </blockquote>
    <br></div></div>
    Be clearer about the problem please.<br>
    <br>
    Do you wish to produce a loop that:<br>
      On pass 1, each of p,k, and t hold the first item of their
    respective lists, and<br>
      on pass 2, each of p,k, and t hold the second item of their
    respective lists, and<br>
      so on<br>
    until one (or all) lists run out?<br></div></blockquote><div><br></div><div style>Yes this is excatly what I want each loop holds the first item on each pass.  </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
    <br>
    If that is what you want, then check out the zip builtin function. 
    But also consider this:  Do you care what happens if one list runs
    out before the others?  <br></div></blockquote><div><br></div><div style>Yes, but all dictionaries have same number of items. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
    <br>
    Or is it something else you want?  Perhaps nested loops?<br>
      for  p in sorted(segments.iterkeys()):<br>
          for k in sorted(class_count.iterkeys()):<br>
              for j in sorted(pixel_count.iterkeys()):<br>
                 # This will be run with all possible combinations of
    p,k, and t</div></blockquote><div><br></div><div style>No, I know about nested loops but I dont want that because all the loops have same number of items, inner loops will run out earlier. </div><div style> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><span class="HOEnZb"><font color="#888888"><br>
    Gary Herron<br>
    <br>
    <br>
    <br>
    <br>
  </font></span></div>

<br>--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
<br></blockquote></div><br></div></div>