Ai
1 Star 0 Fork 0

cf2006/Python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
2.py 1.42 KB
一键复制 编辑 原始数据 按行查看 历史
cf2006 提交于 2025-03-12 20:16 +08:00 . hello
import random
print('''
☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆
☆ ☆
☆ ★ ★ ★ ★ ★ ★ ☆
☆ ★ 猜数字游戏 ★ ☆
☆ ★ ★ ★ ★ ★ ★ ☆
☆ ☆
☆ ★ 版权:chfg ★ ☆
☆ ★ 版本:1.0 ★ ☆
☆ ★ 日期:2025.3.12 ★ ☆
☆ ★ 游戏伤身需适度 ★ ☆
☆ ★ 请勿沉迷游戏 ★ ☆
☆ ☆
☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆''')
computer = random.randint(1,100)
chances = 5
while chances > 0:
player = int(input('来吧,输入你猜的数字(嘻嘻,你可没几次机会哟):'))
if player == computer:
print('居然让你走了狗屎运,才对了,啧~')
break
elif player < computer:
print('猜小了吧,你果然就是不行嘛')
else:
print('猜大了吧,你果然就是不行嘛')
chances -= 1
if chances == 0:
print('呦呦呦,你输了,哈哈哈哈哈哈,嘿嘿,告诉你吧,答案是',computer)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/cf2006/python.git
git@gitee.com:cf2006/python.git
cf2006
python
Python
master

搜索帮助