Skip to content

Instantly share code, notes, and snippets.

@raphapassini
Last active September 22, 2015 19:20
Show Gist options
  • Save raphapassini/c19112b576da055c2b08 to your computer and use it in GitHub Desktop.
Save raphapassini/c19112b576da055c2b08 to your computer and use it in GitHub Desktop.
ladroes = set(['lula', 'dilma', 'pt'])
tempo = set(['clima', 'tempo', 'temperatura'])
pets = set(['gato', 'cachorro', 'papagaio'])
frase = 'eu gosto do clima'
frase_set = set(frase.split())
for s in [ladroes, tempo, pets]:
if s & frase_set:
print 'Encontrei a string que procurava'
print 'SET: {}'.format(s)
print 'FRASE: {}'.format(frase)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment