From 6d9674c6123f4de46710e98ecfb245a535a11128 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Mon, 20 Sep 2021 11:32:52 +0800 Subject: [PATCH] save project --- diy1.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/diy1.py b/diy1.py index 8fa1fd5..0c3475d 100644 --- a/diy1.py +++ b/diy1.py @@ -4,4 +4,14 @@ player=input("请出拳(石头/剪刀/布):") print("玩家出拳"+player) list=["石头","剪刀","布"] oo=random.choice(list) -print("计算机出拳"+oo) \ No newline at end of file +print("计算机出拳"+oo) +if player==oo: + print("平局") +elif player=="石头" and oo=="剪刀": + print("赢") +elif player=="剪刀" and oo=="布": + print("赢") +elif player=="布" and oo=="石头": + print("赢") +else: + print("输") \ No newline at end of file -- libgit2 0.25.0