1、进入phthon可以搜索:IDLE----运行命令
2、phthon中变量首先要赋值
import random//导入模块random str = random.randint(1,10)//调用random中的randint函数 tump = input("qingshur:") guess = int(tump) while guess!=str://只有条件成功,才执行while内的语句 if guess == str: print("caizhongla") else: if guess<str: print ("caixiaole") else: print("caidale")