From 598575572550da58d272186c1101729f2c413fe3 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sat, 20 Mar 2021 14:58:46 +0800 Subject: [PATCH] save project --- 1.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/1.py b/1.py index 11cd576..f125578 100644 --- a/1.py +++ b/1.py @@ -4,11 +4,15 @@ print("玩家出拳:"+player) i=["剪刀","石头","布"] p = random.choice(i) print("电脑出拳:"+p) -if player==p: - print("平局") -else: - if (player=="剪刀" and p=="布") or (player=="石头" and p=="剪刀") or (player=="布" and p=="石头"): - print("玩家胜利") +if player in i : + print("输入正确") + if player==p: + print("平局") else: - print("电脑胜利") + if (player=="剪刀" and p=="布") or (player=="石头" and p=="剪刀") or (player=="布" and p=="石头"): + print("玩家胜利") + else: + print("电脑胜利") +else: + print("输入错误") \ No newline at end of file -- libgit2 0.25.0