There is an alternative solution to this problem, which also applies to duplicate matches.
We start with 2 lists of the same length: emails , otherarray . The goal is to remove items from both lists for each index i where emails[i] == 'something@something.com' .
This can be achieved using list comprehension and then splitting through zip :
emails = ['abc@def.com', 'something@something.com', 'ghi@jkl.com'] otherarray = ['some', 'other', 'details'] from operator import itemgetter res = [(i, j) for i, j in zip(emails, otherarray) if i!= 'something@something.com'] emails, otherarray = map(list, map(itemgetter(0, 1), zip(*res))) print(emails)
jpp May 14 '18 at 14:31 2018-05-14 14:31
source share