x = [1, 2, 3, 4, 5]
y = [2, 4]
def remove_duplicados(l1, l2):
return (i for i in l1 if i not in l2)
z = remove_duplicados(x, y)
print(type(z)) # <class 'generator'>
# Apenas para demonstrar a saída:
print(list(z)) # [1, 3, 5]
eCA9IFsxLCAyLCAzLCA0LCA1XQp5ID0gWzIsIDRdCgpkZWYgcmVtb3ZlX2R1cGxpY2Fkb3MobDEsIGwyKToKICAgIHJldHVybiAoaSBmb3IgaSBpbiBsMSBpZiBpIG5vdCBpbiBsMikKCnogPSByZW1vdmVfZHVwbGljYWRvcyh4LCB5KQoKcHJpbnQodHlwZSh6KSkgICMgPGNsYXNzICdnZW5lcmF0b3InPgoKIyBBcGVuYXMgcGFyYSBkZW1vbnN0cmFyIGEgc2HDrWRhOgpwcmludChsaXN0KHopKSAgIyBbMSwgMywgNV0=