Commit 770c08ff by BellCodeEditor

save project

parent db2f224a
Showing with 9 additions and 9 deletions
...@@ -4,13 +4,13 @@ print("玩家选择"+p) ...@@ -4,13 +4,13 @@ print("玩家选择"+p)
a=["石头","剪刀","布"] a=["石头","剪刀","布"]
n=random.choice(a) n=random.choice(a)
print("电脑选择"+n) print("电脑选择"+n)
if p==n: if p in a :
print("平局") if p==n:
elif p=="石头" and n=="剪刀": print("平局")
print("你赢了") elif (p=="石头" and n=="剪刀")or(p=="布" and n=="石头")or(p=="剪刀" and n=="布"):
elif p=="剪刀" and n=="布": print("你赢了")
print("你赢了") else:
elif p=="布" and n=="石头": print("你输了")
print("你赢了")
else: else:
print("你输了") 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