Commit 508b58ac by BellCodeEditor

auto save

parent c33cd443
Showing with 32 additions and 11 deletions
# 玩家出脚
import random
s=input("请玩家出拳(ss)")
print("玩家出拳:"+s)
p=["石头","布","剪刀"]
b=random.choice(p)
print("电脑出拳"+b)
if s==b:
print("平局")
elif (s=="布" and b=="石头") or (s=="石头" and b=="剪刀") or (s=="剪刀" and b=="布"):
print("获胜")
else:
print("你失败了,你是个失败的人")
num=0
while True:
s=input("请玩家出拳(ss)")
print("玩家出拳:"+s)
p=["石头","布","剪刀"]
b=random.choice(p)
print("电脑出拳"+b)
if s in p:
if s==b:
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