Commit 48841cf7 by BellCodeEditor

auto save

parent a1e7ed8f
Showing with 22 additions and 0 deletions
import random
num=0
while True:
a=input("玩家出拳:")
print("玩家出拳是:"+a)
cq=['石头','剪刀','布']
b=random.choice(cq)
print("电脑出拳:"+b)
if a in cq:
if a==b:
print("平局")
elif (a=="石头" and b=='剪刀') or (a=="剪刀" and b=="布") or (a=="布" 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