Hangman v1

posted Jan 26, 2016, 7:26 AM by Attila Lengyel

def counter(sWord, sChar):
    iCount = 0
    for x in range (0,len(sWord)):
        if sWord[x] == sChar:
            iCount += 1
    return iCount


print("This will be my hangman game")
sWord = input("Give me a word:")

sGuess = ""
while sGuess != "stop":
    sGuess = input("Guess a letter:")
    print(counter(sWord, sGuess[0]))

print("       _________")
print("       |        |")
print("       |        0")
print("       |       /|\\")
print("       |        |")
print("       |       / \\")
print("       |       ")
print("       _________")
print("")

Comments