Commit 508b58ac by BellCodeEditor

auto save

parent c33cd443
Showing with 32 additions and 11 deletions
# 玩家出脚 # 玩家出脚
import random import random
s=input("请玩家出拳(ss)") num=0
print("玩家出拳:"+s) while True:
p=["石头","布","剪刀"] s=input("请玩家出拳(ss)")
b=random.choice(p) print("玩家出拳:"+s)
print("电脑出拳"+b) p=["石头","布","剪刀"]
if s==b: b=random.choice(p)
print("平局") print("电脑出拳"+b)
elif (s=="布" and b=="石头") or (s=="石头" and b=="剪刀") or (s=="剪刀" and b=="布"): if s in p:
print("获胜") if s==b:
else: print("平局")
print("你失败了,你是个失败的人") elif (s=="布" and b=="石头") or (s=="石头" and b=="剪刀") or (s=="剪刀" and b=="布"):
print("获胜")
num=num+1
print("我赢了",num,"次")
if num==3:
print("我成功了")
break
else:
print("输了")
else:
print("不在列表里面")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment