I'm trying to make a dumbed down version of hangman to practice python, I have a count variable but it isn't counting when the condition is met, what am I doing wrong
running = True
words = ['test']
cWord = random.choice(words)
cLength =len(cWord)
count = 0
print("I have chosen a word!")
print("It is a " + str(cLength) + ' letter word')
while running:
userGuess = input("type to guess")
def letterCheck(cWord, userGuess):
for x in cWord:
if userGuess == x:
print(len(x))
if userGuess != x:
counter(count)
def wordCheck(cWord, userGuess, running):
if userGuess != cWord:
pass
if userGuess == cWord:
print('Correct!/n The word was ' + cWord)
running = False
def counter(count):
count += 1
print('Number of tries ' + str(count))
return count
letterCheck(cWord, userGuess)
wordCheck(cWord,userGuess,running)