import random
print ("welcome to my game")
guessestaken = 0
number = random.randint(1,10)
print ("what is your name")
myname = raw_input()
print ("Well,"+ myname + "," + "I'm thinking of a number between 1 and 10"
while guessesTaken < 6:
print ("take a guess")
guess = raw_input()
guess = int(guess)
guesstaken = guesstaken + 1
if guess < number :
print ("your guess is low")
if guess > number :
print ("your guess is high")
if guess == number :
break
if guess == number :
print ("You are awesome ")
guesstaken = str(guessestaken)
print ("You guessed the number in " + guessestaken + " try" )
if guess != number:
print "You lost"
每次我尝试执行它时,都会出现错误“而 guessesTaken < 6: ^ SyntaxError: invalid syntax”