diff --git a/diy1.py b/diy1.py index 0faec9d..1fba1d4 100644 --- a/diy1.py +++ b/diy1.py @@ -1,16 +1,13 @@ import random # 玩家出拳 -if player in list: - player=input("出拳") - print("玩家出了,"+player) - list=["石头","剪刀","布"] - ai=random.choice(list) - print("机器出了,"+ai) - if player == ai: - print("平局") - elif (player=="布" and ai=="石头") or (player=="石头" and ai=="剪刀") or (player=="剪刀" and ai=="布"): - print("玩家获胜") - else: - print("玩家失败") +player=input("出拳") +print("玩家出了,"+player) +list=["石头","剪刀","布"] +ai=random.choice(list) +print("机器出了,"+ai) +if player == ai: + print("平局") +elif (player=="布" and ai=="石头") or (player=="石头" and ai=="剪刀") or (player=="剪刀" and ai=="布"): + print("玩家获胜") else: - print("你TM眼真大啊") + print("玩家失败")