-1

How can i remove an item from a list if it is found to match another item from another list?

for item in bigIpList:
    for item2 in smallIpList:
        if item==item2:
            #remove item from bigIpList
pHorseSpec
  • 1,176
  • 5
  • 18
  • 43

1 Answers1

0

use filter:

bigIpList = filter(lambda e: e not in smallIpList, bigIpList)
hhbilly
  • 1,175
  • 8
  • 18