Python之石头剪刀布
2019-01-25 18:00
351 查看
叮:页面显示有问题,参考代码注意缩进
import random
#根据输入参数显示对应结果
while True:
#获取输入参数
play = int(input("请输入您得动作(0剪刀 1石头 2布 或退出程序 3):"))
#电脑随机动作动作
computer = random.randint(0, 2)
if (play ==0 and computer ==2) or (play == 1 and computer ==0) or(play == 2 and computer == 1) : print("你赢了,混蛋") elif play == computer: print("平局") elif play == 3: break else: print("输光了,改天再来吧")
相关文章推荐
- python实战===石头剪刀布,简单模型
- python关于石头剪刀布的一道题
- Python实现简单石头剪刀布游戏
- Python编写的一个简单的石头剪刀布游戏
- Python学习-if分支-石头剪刀布游戏
- python实现石头剪刀布小游戏
- python----石头剪刀布
- Python核心编程中的一个游戏练习题,石头剪刀布
- Python 石头剪刀布,小游戏
- python实现石头剪刀布程序
- 石头剪刀布游戏的python代码
- Python 石头剪刀布
- python基础教程之实现石头剪刀布游戏示例
- python基础教程之实现石头剪刀布游戏示例
- Python的傻样
- python 学习笔记二
- Python完全新手教程
- Python高效编程技巧
- 【语言处理与Python】4.7算法设计
- Python_MISC2