Commit 7201004e by BellCodeEditor

save project

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