Commit c3c97ba5 by BellCodeEditor

save project

parent fdf1a1c2
Showing with 9 additions and 6 deletions
...@@ -4,9 +4,12 @@ print("玩家出拳:"+x) ...@@ -4,9 +4,12 @@ print("玩家出拳:"+x)
list=["石头","剪刀","布"] list=["石头","剪刀","布"]
y=random.choice(list) y=random.choice(list)
print("机器人出拳:"+y) print("机器人出拳:"+y)
if x==y: if x in list:
print("平局") if x==y:
elif (x=="石头" and y=="剪刀") or (x=="剪刀" and y=="布") or (x=="布" and y=="石头"): print("平局")
print("玩家胜") elif (x=="石头" and y=="剪刀") or (x=="剪刀" and y=="布") or (x=="布" and y=="石头"):
print("玩家胜")
else :
rint("机器人胜")
else : else :
rint("机器人胜") print("请重新输入")
\ No newline at end of file \ 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