Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- word = ['a', 'w', 'a', 'k', 'e']
- word_blank = ['-', '-', '-', '-', '-']
- num_attempts = 10
- player_guess = input(("Guess a letter. You have %s chances left. ") % num_attempts)
- print(word_blank)
- while num_attempts != 0:
- for word in word_blank:
- if player_guess == word[0]:
- word_blank[word.index(word)] = player_guess
- print ("That is correct")
- else:
- num_attempts -= 1
- print(("Incorrect, you have %d attempts left") % num_attempts)
- player_guess = input(("Guess a letter. You have %s chances left. ") % num_attempts)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement