import random
n = random.randint(0,10)
while count <5:
guss_number = int(input("请输入一个数字:"))
if n > guss_number:
print("猜小了!")
elif n < guss_number:
print("猜大了!")
else:
print("恭喜你,猜对了!")
break
count +=1
原文:https://www.cnblogs.com/D007/p/13705856.html