Last active
April 17, 2019 00:01
-
-
Save MoisesTedeschi/7c615aaa0e9f6b9711d846f1f684916d to your computer and use it in GitHub Desktop.
Aplicando teoria dos conjuntos em listas de emails com Python.
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
""" | |
Aplicando teoria dos conjuntos em listas de emails com Python | |
Created: 16/04/2019 | |
@author: Moisés Tedeschi | |
""" | |
lista1 = ["eu@mesmo", "moisestedeschi@gmail.com","moatedeschi@gmail.com", "moises.tedeschi@esporte.gov.br"] | |
# James, corrigi seu nome no e-mail. Não fica chateado (rsrs) | |
lista2 = ["eu@mesmo", "jamesperes@gmail.com", "moises.tedeschi@esporte.gov.br"] | |
print (set(lista1).intersection(lista2)) | |
# Resultado de saída da intersecção entre dois conjuntos (listas de email) é: | |
# {'moises.tedeschi@esporte.gov.br', 'eu@mesmo'} | |
print (set(lista1).difference(lista2)) | |
# Resultado de saída da diferença entre os conjuntos é: | |
# {'moatedeschi@gmail.com', 'moisestedeschi@gmail.com'} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment