w.r.t. prob 2, there is no break/continue in the code that you have given. I added the "break" statement after you remove the word from lstB and code does seems to work for me.<br><br> <snip /><br> if word in lstB:
<br> lstB.remove(word)<br> print<br> print "Removed", word<br> break<br> <snip /><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> <<a href="mailto:rdm@rcblue.com">rdm@rcblue.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;">
At 10:53 PM 10/11/2007, Dick Moores wrote:<br>>Please see the code and it's output here:<br>><<a href="http://www.rcblue.com/Python/buggy_For_Web.py">http://www.rcblue.com/Python/buggy_For_Web.py</a>><br>>
<br>><br>>I'm attempting to eliminate the elements (strings) of lstA that are<br>>not well-formed in that they contain at least one character that is<br>>not in the string astr.<br>><br>>Problems:<br>
>1) If lstA[n] is removed, lstA[n+1] is skipped--isn't examined at<br>>all, and remains in the final form of lstA whether well-formed or not.<br>><br>>Using print statements is as far as my debugging skills go, so you
<br>>can see of bunch of them in the code. I did try to use winpdb for the<br>>first time, but haven't figured it out yet. Ulipad now has it built<br>>in, so I'd like to learn to use it it..<br>><br>>2) I'm not able to get the "for char in wordWithCommas:" loop to stop
<br>>examining a wordWithCommas after it's word has been removed. I've<br>>tried "continue" and "break" in various places to no avail.<br>><br>>I'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 - <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