From 7a49df3cf6cdbd6483625fdf3e57509b379f3007 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Fri, 17 Dec 2021 15:03:29 +0800 Subject: [PATCH] save project --- diy1.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 diy1.py diff --git a/diy1.py b/diy1.py new file mode 100644 index 0000000..a851c93 --- /dev/null +++ b/diy1.py @@ -0,0 +1,16 @@ +# 玩家出拳 +a=input("石头/剪刀/布") +print("玩家出拳:"+a) +import random +computer=["石头","剪刀","布"] +b=random.choice(computer) +print("计算机出拳:"+b) +if a in computer: + if a==b: + print("平局") + elif a=="石头" and b=="剪刀" or a=="剪刀" and b=="布" or a=="布" and b=="石头": + print("恭喜你,你赢了") + else: + print("很遗憾,你输了") +else: + print("输入错误") \ No newline at end of file -- libgit2 0.25.0