Gguess The Word Lab
Gguess The Word Lab
print("Let's play Guess the Word. Guess a letter that you think is in the word. Y
print()
print()
print()
print()
secret_word = list(user_word)
word_so_far = len(user_word) * ['_']
game = True
list_of_guessed = []
incorrect_guesses = 0
print(word_so_far)
for x in range(len(secret_word)):
if (guess == secret_word[x]):
word_so_far[x] = guess
print("Yes!")
print(word_so_far)
correct_this_round +=1
if (correct_this_round == 0):
incorrect_guesses+=1
print ('Wrong Guess!')
print('You have made {} incorrect guesses.'.format(incorrect_guesses))
if (secret_word == word_so_far):
print ("Yay! You've guessed the right word.")
play_again = input('Would you like to play again? Answer yes or no.')
else:
game == False
print('Thanks for playing!')
if (incorrect_guesses == 6):
print("You've had too many wrong guesses! Game over.")
play_again = input('Would you like to play again? Answer yes or no.')
else:
game == False
print('Thanks for playing!')
In [ ]: