像这样的东西:
>>> lis = [[0, 0], [0, 1], [1, 0], [0, 2], [1, 1], [2, 0], [0, 3], [1, 2], [2, 1], [3, 0]]
>>> lis1 = [[0, 3], [3, 0]]
#generate lis2 from lis1 based on a condition
>>> lis2 = [[y if y!=3 else y-2 for y in x] for x in lis1]
>>> lis2
[[0, 1], [1, 0]]
#use sets to improve time complexity
>>> s = set(tuple(x) for x in lis2)
#Now use set intersection or a list comprehension to get the
#common elements between lis2 and lis1. Note that set only contains unique items
#so prefer list comprehension if you want all elements from lis that are in lis2
#as well.
>>> [x for x in lis if tuple(x) in s]
[[0, 1], [1, 0]]
>>> s.intersection(map(tuple,lis))
{(0, 1), (1, 0)}