Python学习之While语句小游戏

匿名 (未验证) 提交于 2019-12-02 22:11:45
版权声明:指剑 https://blog.csdn.net/fly1574/article/details/90403078
import random secret = random.randint(1,10) temp = input('不妨猜一下我现在心里想的数字:') guess = int(temp) while guess != secret:     temp = input('猜错了,重新猜一下吧:')     guess = int(temp)     if guess == secret:         print('我丢,你咋知道我想的是这呢?')     else:         if guess >secret:             print('嘿,大了大了')         else:             print('又小了') print('Game Over,不玩了') 
文章来源: https://blog.csdn.net/fly1574/article/details/90403078
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!