Commit 67266020 by BellCodeEditor

save project

parent b184d803
Showing with 7 additions and 3 deletions
...@@ -15,9 +15,12 @@ print("玩家出拳:"+player) ...@@ -15,9 +15,12 @@ print("玩家出拳:"+player)
lite=["石头","剪刀","布"] lite=["石头","剪刀","布"]
robot=random.choice(lite) robot=random.choice(lite)
print(robot) print(robot)
if player==robot: if player in lite:
if player==robot:
print("平局") print("平局")
elif(player=="石头" and robot=="剪刀") or (player=="剪刀" and robot=="布") or (player=="布" and robot=="石头"): elif(player=="石头" and robot=="剪刀") or (player=="剪刀" and robot=="布") or (player=="布" and robot=="石头"):
print("恭喜,你赢了") print("恭喜,你赢了")
else: else:
print("抱歉,你输了") 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