From 3c707bfabb9ae16cda194bbdefd895b969abb710 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sun, 27 Mar 2022 17:27:01 +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..fcae943 --- /dev/null +++ b/diy1.py @@ -0,0 +1,16 @@ +# 玩家出拳 +player=input("请出拳(剪刀/石头/布):") +print("玩家出拳:"+player) +import random +list=["石头","剪刀","布"] +computer=random.choice(list) +print("计算机出拳:"+computer) +if player in list: + if computer==player: + print("平局") + elif ((computer=="石头" and player=="布") or (computer=="剪刀" and player=="石头") or (computer=="布" and player=="剪刀")): + print("你赢了") + else: + print("你输了") +else: + print("输入错误") \ No newline at end of file -- libgit2 0.25.0