From c97c3dfd4e9562f31d9a8ad249213bd1cb481b13 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sat, 27 Nov 2021 09:09:28 +0800 Subject: [PATCH] save project --- diy1.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 diy1.py diff --git a/diy1.py b/diy1.py new file mode 100644 index 0000000..784a791 --- /dev/null +++ b/diy1.py @@ -0,0 +1,13 @@ +# 玩家出 +player=input("请输入/石头/剪刀/布:") +print("出的是:" + player) +import random +list=["石头","剪刀","布"] +computer = random.choice(list) +print("电脑出的是:"+computer) +if player==computer: + print("平局") +elif (player=="石头" and computer=="剪刀") or (player=="剪刀" and computer=="布") or (player=="布" and computer=="石头"): + print("你赢了") +else: + print("你输了") \ No newline at end of file -- libgit2 0.25.0