Thats for this very humorous reply =D<br><br><div><span class="gmail_quote">On 10/26/06, <b class="gmail_sendername">Luke Paireepinart</b> <<a href="mailto:rabidpoobear@gmail.com">rabidpoobear@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Chris Hengge wrote:<br>> Here is my code:<br>> for unWantedItem in directoryList:<br>> try:
<br>> if "hex" in unWantedItem.lower():<br>> if not "bmc" in unWantedItem.lower():<br>> print unWantedItem + " removed!"<br>
> directoryList.remove(unWantedItem)<br>><br>> This only seems to loop through once, and removes 1 of 2 occurances<br>> from this list that should be captured. Should "for" keep the list
<br>> going through each instance?<br>><br>You're removing stuff from something you're iterating over!<br>*slaps your fingers with a ruler*<br>Make a copy of the list!<br>HTH,<br>-Luke<br><br></blockquote></div><br>