I am having problem with function that I have created, it does not stop, can anyone suggest what am I doing wrong?
import random
words = ["monitor", "mouse", "CPU", "keyboard"]
attempts = []
randomWord = random.choice(words)
noChar = len(randomWord)
print randomWord , noChar
print "Hello, Welcome to the game of Hangman. You have to guess the given word. The first word has", noChar, " letters."
def game():
guess = raw_input ("Please choose letter")
attempts.append(guess)
print (attempts)
if guess in randomWord:
print "You have guessed the letter"
else:
print "Please try again"
return()
chance = raw_input ("Have a guess")
while chance!= randomWord:
game()
returnis a statement (should not have parenthesis)