Commit 7201004e by BellCodeEditor

save project

parent 5f57f2b2
Showing with 18 additions and 8 deletions
import random
xxx=input("出拳:")
print("玩家出拳是:"+xxx)
x=["剪刀","石头","布"]
xx=random.choice(x)
print(xx)
if xxx==xx:
sum=0
while True :
xxx=input("出拳:")
print("玩家出拳是:"+xxx)
x=["剪刀","石头","布"]
xx=random.choice(x)
print(xx)
if xxx in x:
if xxx==xx:
print("平局")
elif (xxx=="石头"and xx=="剪刀") or (xxx=="剪刀"and xx=="布") or (xxx=="布"and xx=="石头") :
elif (xxx=="石头"and xx=="剪刀") or (xxx=="剪刀"and xx=="布") or (xxx=="布"and xx=="石头") :
print("我赢了")
else :
sum=sum+1
print("我赢了:",sum,"局")
if sum==5:
break
else :
print("我败了")
else :
print("输入错误!")
\ No newline at end of file
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