我尝试运行代码,但是它不断在数字上出现语法错误:
我尝试了许多修复程序,但没有发现任何有效的方法
import random
guessesTaken = 0
print('Hello! What is your name?')
myName = input()
number = random.randit(1, 20)
print('Well, ' + myName + ', I am thinking of a number between 1 and 20.')
for guessesTaken in range(6):
print('Take a guess.') # four spaces in front of "print"
guess = input()
guess = int(guess)
if guess < number:
print('Your guess is too low.')
if guess > number:
print('Your guess is too high.')
if guess == number:
break
if guess == number:
guessesTaken = str(guessesTaken + 1)
print('Good job, '+ myName + '! You guessed my number in ' +
guessesTaken = str(guessesTaken + 1)
if guess != number:
number = str(number)
print('Nope. The number I was thinking of was' + number + '.'
我希望它可以运行,但是它只运行语法错误