Python 猜数字游戏 这个东西实现比较简单,直接放代码吧。 import random n=random.randint(1,1000) def echo(a): #定义函数 if int(a)>n: