Last active
August 29, 2015 14:18
-
-
Save arthurbarros/fe0ab1dce62ad61d63b2 to your computer and use it in GitHub Desktop.
Solução para o problema proposto em http://hotsites.folha.com.br/2015/03/31/selecao/
This file contains hidden or 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
import string | |
def words_product(word): | |
words = string.ascii_uppercase | |
multiplier = 1 | |
for letter in word.upper(): | |
multiplier *= words.index(letter) + 1 | |
return multiplier % 45 | |
def employed_devs(comet, group): | |
return words_product(comet) == words_product(group) | |
for comet, group in [('HALLEY','AMARELO'), ('ENCKE','VERMELHO'), ('WOLF','PRETO'), ('KUSHIDA','AZUL')]: | |
if employed_devs(comet, group) == False: | |
print 'Sentimos muito em informar que ninguem do grupo %s e cometa %s sera levado :(' % (comet, group) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment