1
print("*** Jogo da forca ***\n")
print("*** Feito por Igor! ***\n")
palavraSecreta = input("Entre com a palavra secreta: ")
letrasDescobertas = []
percorrer = 0
contador = int(input("Entre com o número de chances: "))
for i in range(len(palavraSecreta)):
    if palavraSecreta[i] == " ":
        letrasDescobertas.append(" ")
    else:
        letrasDescobertas.append("-")
print("".join(letrasDescobertas))
acertou = False
while acertou is False:
    letra = input("Digite a letra de seu chute: ")
    for i in range(len(palavraSecreta)):
        if letra == palavraSecreta[i]:
            letrasDescobertas[i] = letra
            print("".join(letrasDescobertas))
    if letra not in palavraSecreta:
        percorrer += 1
        print("Chances restantes:", contador - percorrer)
        if percorrer == contador:
            print("Você perdeu!")
            break
    if "-" not in letrasDescobertas:
        print("Você ganhou com %d erros!" % percorrer)
        acertou = True
My riddle is pao: If I type d, f, g. I should show the wrong letters like this: d, f, g. But the output I have with this code I did is only the last letter typed. For example: Typed d, will appear d. Typed f, will appear only f, instead of d, f. How to tidy up? Thanks
It could make the code easier?
– Antony Gabriel
Okay, the code is up (the indentation got a little wrong here on the site)
– Pigot