如何通过组合成一个列表理解来解决以下代码重复?
myList =[ //someList ]
thierList=[ //someOtherList ]
if name:
[x for x in range(2,100) if x%2 and x in mylist and x not in theirList]
else:
[x for x in range(2,100) if x in mylist and x not in theirList]