Commit bb79b99f by BellCodeEditor

save project

parent ff89fecd
Showing with 8 additions and 6 deletions
...@@ -4,9 +4,12 @@ print("玩家出拳"+player_1) ...@@ -4,9 +4,12 @@ print("玩家出拳"+player_1)
computer = ["剪刀","石头","布"] computer = ["剪刀","石头","布"]
computer_1 = random.choice(computer) computer_1 = random.choice(computer)
print("电脑出拳"+computer_1) print("电脑出拳"+computer_1)
if computer_1 ==player_1: if player_1 in computer:
print("平局") if computer_1 ==player_1:
elif (player_1 == "剪刀" and computer_1 =="布")or(player_1 == "布" and computer_1 == "石头")or(player_1 =="石头" and computer_1 == "剪刀"): print("平局")
print(" you win") elif (player_1 == "剪刀" and computer_1 =="布")or(player_1 == "布" and computer_1 == "石头")or(player_1 =="石头" and computer_1 == "剪刀"):
print(" you win")
else:
print("you lose")
else: else:
print("you lose") 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