a = 3
groups = [[3, 2], [3, 4], [1, 2], [5, 4], [4, 3]]
groups_no_a = []
for group in groups:
    if a not in group:
        groups_no_a.append(group)
print(groups_no_a)
Check item membership in set in Python