-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,246
  • 5
  • 19
  • 48

1 Answers1

0

use filter:

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