from random import randint
myNumber = randint(1000,9999)
guessNum = 0
correctNumbers = 0
Input = False
Userguess = 0
print ("Welcome to Guess The Number")
print ("try to guess my number between 1000 and 9999")
while Input == False:
Userguess = int(raw_input("Guess a number betweeb 1000 and 9999: ")
guessNum += 1
if Userguess == myNumber:
print("Well Done, you guessed the number in" + str(NumberGuesses) + "guesses")
Input = True
该程序猜测数字游戏,用户必须猜测1000
和9999
之间随机生成的数字。
答案 0 :(得分:0)
第13行缺少括号。
Userguess = int(raw_input("Guess a number betweeb 1000 and 9999: "))