Hi,<br><br>In this case, I&#39;d go for the simple old fashioned for loop with a boolean:<br><br>found = False<br>for thing in Things:<br>&nbsp;&nbsp;&nbsp; if thing.value &gt; 0:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; found = True<br>&nbsp;&nbsp;&nbsp; if found:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; thing.value
 = 2<br><br>Remco Gerlich<br><br><div class="gmail_quote">On Dec 6, 2007 9:48 AM, ted b &lt;<a href="mailto:phpmoonlighter@yahoo.com">phpmoonlighter@yahoo.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Can you suggest a good way to iterate through the<br>remainder of list and update them?<br><br>Ex:<br>Thing1.value = 0<br>Thing2.value = 1<br>Thing3.value = 0<br>Thing4.value = 0<br><br>Things = [Thing1, Thing2, Thing3, Thing4]
<br><br>I want to iterate through &#39;Things&#39; and if<br>&#39;Thing.value&#39; &gt; 0, then I want to set all values for<br>that and the subsequent &#39;Things&#39; in the list to 2<br><br>So that i&#39;d end up with<br>
<br>Thing1.value = 0<br>Thing2.value = 2<br>Thing3.value = 2<br>Thing4.value = 2<br><div class="WgoR0d"><br><br> &nbsp; &nbsp; &nbsp;____________________________________________________________________________________<br>Be a better friend, newshound, and
<br>know-it-all with Yahoo! Mobile. &nbsp;Try it now. &nbsp;<a href="http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ" target="_blank">http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ</a><br><br>_______________________________________________
<br>Tutor maillist &nbsp;- &nbsp;<a href="mailto:Tutor@python.org">Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br></div></blockquote>
</div><br>