import random words = ['bolt','nut','wrench','camera','loss','giraffe','contract','mud','effort','robotics'] secret_word = random.choice(words) print(secret_word) correct_guesses = [] incorrect_guesses = [] lives = 10 blank_spaces = '' for letter in secret_word: blank_spaces += '_ ' print(blank_spaces) ready = input('Are you ready to play? yes/no ').lower() while not ready == 'yes': ready = input('Are you ready to play? yes/no ').lower() while True: user_input = input("Guess one letter at a time or guess the entire word: ").lower() if user_input == secret_word: print('You got the whole thing!') correct_guesses += list(user_input) elif user_input in correct_guesses or user_input in incorrect_guesses: print('You already guessed that!') elif user_input in secret_word: print('Good guess!') correct_guesses += list(user_input) else: print('Nope, try again!') incorrect_guesses += list(user_input) lives -= 1