"Girish Sahani" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > I am trying to modify a list of pairs (l4) by removing those > pairs which are not present in a third list called pairList. > The following is a simplified part of the routine i have written. However > it does not give the correct output. Please help! > Its possible i have made a trivial mistke since i am a newbie. >
You've fallen victim to one of the Classic Blunders! The First is "Never start a land war in Asia!", but the second, only slightly lesser known is "Never modify a list that you are iterating over!" -- Paul -- http://mail.python.org/mailman/listinfo/python-list