Commit 41e933e6 by BellCodeEditor

save project

parent 2cb9dfd9
Showing with 9 additions and 5 deletions
...@@ -3,9 +3,13 @@ player=input("请出拳:石头/剪刀/布")# 玩家出拳 ...@@ -3,9 +3,13 @@ player=input("请出拳:石头/剪刀/布")# 玩家出拳
print("玩家出拳:"+player) print("玩家出拳:"+player)
list = ["石头","剪刀","布"] list = ["石头","剪刀","布"]
computer = random.choice(list) computer = random.choice(list)
if player == computer: if player=="石头" and player=="剪刀" and player=="布"
player("平局") if player == computer:
elif player=="剪刀" and computer=="布" or player=="石头" and computer=="剪刀" or player=="布" and computer=="石头": player("平局")
print("你赢了") elif player=="剪刀" and computer=="布" or player=="石头" and computer=="剪刀" or player=="布" and computer=="石头":
print("你赢了")
else:
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