From fe04d05281c46f3bd7025e1b21137829cd5140f9 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sat, 23 Jan 2021 18:01:36 +0800 Subject: [PATCH] save project --- diy1.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/diy1.py b/diy1.py index 2ec2e99..f0ae1ac 100644 --- a/diy1.py +++ b/diy1.py @@ -3,4 +3,10 @@ print("玩家出拳"+player) import random list=["石头","剪刀","布"] computer=random.choice(list) -print("电脑出拳:"+computer) \ No newline at end of file +print("电脑出拳:"+computer) +if computer == player: + print("平局") +elif player=="剪刀" and computer=="布" or player=="石头" and computer=="剪刀" or player=="布" and computer=="石头": + print("玩家胜利") +elif player=="剪刀" and computer=="石头" or player=="石头" and computer=="布" or player=="布" and computer=="剪刀": + print("电脑胜利") -- libgit2 0.25.0