import random
# Lista de palavras e as respectivas dicas:
WORDS = [
("palavra1", ["dica1", "dica2", "dica3", "dica4"]),
("palavra2", ["dica1", "dica2", "dica3", "dica4"]),
("palavra3", ["dica1", "dica2", "dica3", "dica4"])
]
# Sorteia uma palavra:
word = random.choice(WORDS)
# Gera o anagrama da palavra:
anagram = list(word[0])
anagram.sort()
anagram = "".join(anagram)
# Exibe o anagrama:
print("Tente adivinhar:", anagram)
# Cinco tentativas:
for i in range(5):
# Lê a tentativa do usuário:
guess = input("Tentativa #{}: ".format(i+1))
# Varifica se o usuário acertou:
if guess == word[0]:
# Sim, exime a mensagem e encerra o loop:
print("Parabens! Você acertou.")
break
# Não, exibe uma dica:
print("Dica:", word[1].pop(0))
else:
# O usuário não acertou a palavra:
print("Ihh, não foi dessa vez.")
aW1wb3J0IHJhbmRvbQoKIyBMaXN0YSBkZSBwYWxhdnJhcyBlIGFzIHJlc3BlY3RpdmFzIGRpY2FzOgpXT1JEUyA9IFsKICAgICgicGFsYXZyYTEiLCBbImRpY2ExIiwgImRpY2EyIiwgImRpY2EzIiwgImRpY2E0Il0pLAogICAgKCJwYWxhdnJhMiIsIFsiZGljYTEiLCAiZGljYTIiLCAiZGljYTMiLCAiZGljYTQiXSksCiAgICAoInBhbGF2cmEzIiwgWyJkaWNhMSIsICJkaWNhMiIsICJkaWNhMyIsICJkaWNhNCJdKQpdCgojIFNvcnRlaWEgdW1hIHBhbGF2cmE6CndvcmQgPSByYW5kb20uY2hvaWNlKFdPUkRTKQoKIyBHZXJhIG8gYW5hZ3JhbWEgZGEgcGFsYXZyYToKYW5hZ3JhbSA9IGxpc3Qod29yZFswXSkKYW5hZ3JhbS5zb3J0KCkKYW5hZ3JhbSA9ICIiLmpvaW4oYW5hZ3JhbSkKCiMgRXhpYmUgbyBhbmFncmFtYToKcHJpbnQoIlRlbnRlIGFkaXZpbmhhcjoiLCBhbmFncmFtKQoKIyBDaW5jbyB0ZW50YXRpdmFzOgpmb3IgaSBpbiByYW5nZSg1K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