Guessing game


Do you know how I can make this code into a game that guesses words?

Here it is:

def goguess():
guess = '1' # initialization with a bad guess
answer = 'card'
while guess not in answer:
guess = raw_input('Name a letter in \''+answer+'\': ')
print('Thank you!')


How about this?

user_guess = raw_input("Please enter your word")
answer = 'card'

def goguess(user_guess,answer):

if (user_guess == answer)
print("sorry you guessed wrong")
again = raw_input ("Please enter word")
goguess(again, answer)