w.r.t. prob 2, there is no break/continue in the code that you have given. I added the &quot;break&quot; statement after you remove the word from lstB and code does seems to work for me.<br><br>&nbsp; &lt;snip /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if word in lstB:
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lstB.remove(word)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;Removed&quot;, word<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break<br>&nbsp; &lt;snip /&gt;<br><br>Can you specify where did you try putting break/continue ?<br>
<br><br><div><span class="gmail_quote">On 10/12/07, <b class="gmail_sendername">Dick Moores</b> &lt;<a href="mailto:rdm@rcblue.com">rdm@rcblue.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
At 10:53 PM 10/11/2007, Dick Moores wrote:<br>&gt;Please see the code and it&#39;s output here:<br>&gt;&lt;<a href="http://www.rcblue.com/Python/buggy_For_Web.py">http://www.rcblue.com/Python/buggy_For_Web.py</a>&gt;<br>&gt;
<br>&gt;<br>&gt;I&#39;m attempting to eliminate the elements (strings) of lstA that are<br>&gt;not well-formed in that they contain at least one character that is<br>&gt;not in the string astr.<br>&gt;<br>&gt;Problems:<br>
&gt;1) If lstA[n] is removed, lstA[n+1] is skipped--isn&#39;t examined at<br>&gt;all, and remains in the final form of lstA whether well-formed or not.<br>&gt;<br>&gt;Using print statements is as far as my debugging skills go, so you
<br>&gt;can see of bunch of them in the code. I did try to use winpdb for the<br>&gt;first time, but haven&#39;t figured it out yet. Ulipad now has it built<br>&gt;in, so I&#39;d like to learn to use it it..<br>&gt;<br>&gt;2) I&#39;m not able to get the &quot;for char in wordWithCommas:&quot; loop to stop
<br>&gt;examining a wordWithCommas after it&#39;s word has been removed. I&#39;ve<br>&gt;tried &quot;continue&quot; and &quot;break&quot; in various places to no avail.<br>&gt;<br>&gt;I&#39;d appreciate some help.<br><br>
Now that Aditya and Alan have come to my rescue, problem #1 has been<br>solved. But #2 remains..<br><br>Dick<br><br><br>_______________________________________________<br>Tutor maillist&nbsp;&nbsp;-&nbsp;&nbsp;<a href="mailto:Tutor@python.org">
Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</a><br></blockquote></div><br><br clear="all"><br>-- <br>Aditya