From da815045702fce96e161a9a2f01fb2904e8b4cb3 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Mon, 20 Sep 2021 10:07:08 +0800 Subject: [PATCH] save project --- diy1.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 diy1.py diff --git a/diy1.py b/diy1.py new file mode 100644 index 0000000..327f3d3 --- /dev/null +++ b/diy1.py @@ -0,0 +1,18 @@ +p=input("你要出什么全") +print(p) + +import random +list1=["石头","剪刀","布"] +c=random.choice(list1) +print(c) + +list = ["石头","剪刀","布"] +if p in list: + if p==c: + print("平局") + elif (p=="剪刀" and c=="布") or (p=="石头" and c=="剪刀") or (p=="布" and c=="石头"): + print("玩家胜利") + else : + print("电脑失败") +else: + print("输入错误") \ No newline at end of file -- libgit2 0.25.0