猜数字
- 代码
'''
猜数字小游戏,不断输入你所猜的数(1-100),程序会根据你的输入提醒你进行
适当调整所猜数的大小,直到最后猜出这个随机数
'''
guessNumber = random.randint(1,100)
print("I'm thinking a number between 1 and 100.")
while True:
print('Take a guess.')
guess = int(input())
if guess > guessNumber:
print("It's too high")
elif guess < guessNumber:
print("It's to low")
else:
print("Congratulations, you win.")
break'''
猜数字小游戏,不断输入你所猜的数(1-