# This is a sample Python script. # Press Shift+F10 to execute it or replace it with your code. # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. import random secret = random.randint(0,10) print('Hi,欢迎来到猜数字游戏!快快开始吧!............') temp = input('不妨猜一下小甲鱼现在心里想的是哪个数字?') guess = int(temp) while guess != 8: temp = input('哎呀!猜错了,请重新输入吧') guess = int(temp) if guess == 8: print('我草,你是小甲鱼肚子里的蛔虫吗?') print('哼,猜中了也没有奖励,哈哈!') else: if guess > 8: print('哥,大了!大了!!') else: print('嘿,小了!小了!!') print('猜错了,小甲鱼现在想的不是8。') print('游戏结束,不玩啦~~') #print('............查询函数说明............') #help(input) #如何查询函数清单???
【python】python自学笔记(猜谜游戏)
最新推荐文章于 2024-07-29 14:37:54 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)