发布时间:2019-08-06 13:56:23编辑:auto阅读(1836)
叮:页面显示有问题,参考代码注意缩进
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列表处理效率对比测试
48102
46789
37711
35037
29576
26237
25166
20203
19841
18315
5988°
6672°
6164°
6153°
7264°
6103°
6212°
6684°
6649°
8040°