Commit fea97147 by BellCodeEditor

auto save

parent f7edaf5f
Showing with 11 additions and 9 deletions
...@@ -2,13 +2,15 @@ import random ...@@ -2,13 +2,15 @@ import random
x=input("出拳:") x=input("出拳:")
xxx=["布","剪刀","石头"] xxx=["布","剪刀","石头"]
xx=random.choice(xxx) xx=random.choice(xxx)
xxxx=
print(xx) print(xx)
if x in xxx : while True:
if x==xx: if x in xxx :
print("平局") if x==xx:
elif (x=="石头" and xx =="剪刀") or (x=="剪刀" and xx =="布") or (x=="布" and xx =="石头"): print("平局")
print("你赢了") elif (x=="石头" and xx =="剪刀") or (x=="剪刀" and xx =="布") or (x=="布" and xx =="石头"):
print("你赢了")
else:
print("你输了")
else: else:
print("你输了") print("输入错误
else: \ No newline at end of file
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