Created
June 1, 2018 16:58
-
-
Save acwoss/e46b41bf8fafcf906a3e37ff19e05cb1 to your computer and use it in GitHub Desktop.
LimeFrozenTwintext created by acwoss - https://repl.it/@acwoss/LimeFrozenTwintext
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
# Alteração em y: | |
y.append(3) | |
print(type(z)) # <class 'generator'> | |
# Saída de z modificada devido alteração em y: | |
print(list(z)) # [1, 5] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment