用 while 循环作个小游戏

import random #可输入次数 flag = 0 #生成一个1到10之间的随机整数 res = random.randint(1,10) #判读三次输入机会 while(flag<3): temp = input('来,猜猜我内心想的数字是什么?\r\n') #格式化输入的字符串数字为整型 temp = int(temp) #若是相等 if te
相关文章
相关标签/搜索