新建程序文件 “姓名-4-3.py”,用while循环改写【例3-8】 游戏猜数字程序:随机产生一个0-10间的整数,玩家通过键 盘输入一个数竞猜,若猜中,则输出“恭喜你猜对啦!”, 否则输出“很遗憾,没有猜对哟!”,直到用户输入-1结束 游戏
时间: 2024-06-01 10:12:04 浏览: 9
import random
num = random.randint(0, 10)
guess = int(input("请输入一个0-10之间的整数,猜猜看:"))
while guess != -1:
if guess == num:
print("恭喜你猜对啦!")
break
else:
print("很遗憾,没有猜对哟!")
guess = int(input("请继续输入一个0-10之间的整数,猜猜看:"))
相关问题
新建程序文件 “姓名-4-3.py” • 用while循环改写【例3-8】 游戏猜数字程序:随机产生- 一个0-10间的整数,玩家通过键 盘输入一个数竞猜,若猜中,则输出“恭喜你猜对啦! 否则输出“很遗憾,没有猜对哟!” ,直到用户输入-1结束 游戏
import random
num = random.randint(0, 10)
guess = int(input("猜一猜这个数字是多少(0-10):"))
while guess != -1:
if guess == num:
print("恭喜你猜对啦!")
break
else:
print("很遗憾,没有猜对哟!")
guess = int(input("再试一次吧(或输入-1退出):"))
cefpython3-66.1-py2.py3-none-win32.whl
cefpython3-66.1-py2.py3-none-win32.whl是CEFPython库的一个特定版本的安装文件。CEFPython是一个用于在Python中嵌入Chromium浏览器的库,它允许你在Python应用程序中显示和操作Web内容。要安装cefpython3-66.1-py2.py3-none-win32.whl,你可以使用pip命令进行安装,如下所示:pip install cefpython3-66.1-py2.py3-none-win32.whl。请确保你已经正确安装了pip,并且在命令行中运行该命令时,你的当前目录是cefpython3-66.1-py2.py3-none-win32.whl所在的目录。
#### 引用[.reference_title]
- *1* [pywebview 通过 JSBridge 调用本地 python程序](https://blog.csdn.net/belldeep/article/details/131604921)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [SUSE Linux Enterprise 11 离线安装 DLIB 人脸识别 python机器学习模块](https://blog.csdn.net/weixin_30564785/article/details/96818966)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![whl](https://img-home.csdnimg.cn/images/20210720083646.png)
![whl](https://img-home.csdnimg.cn/images/20210720083646.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)