Guessing game


#1

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!')


#2

How about this?

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

def goguess(user_guess,answer):

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