From 360f5923f21ec80ceffdbaaf2cffe1c8889a8590 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sat, 26 Mar 2022 18:21:04 +0800 Subject: [PATCH] save project --- diy1.py | 17 ++++++++++++++++- jk.py | 23 +++++++++++++---------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/diy1.py b/diy1.py index 96eecc9..9400789 100644 --- a/diy1.py +++ b/diy1.py @@ -2,4 +2,19 @@ player=input("请出拳:石头/剪刀/布")# 玩家出拳 print("玩家出拳:"+player) import random list["石头","剪刀","布"] -sbyoubing=random.choice(list) \ No newline at end of file +sbyoubing=random.choice(list) + + + if player in list + if player==computer + print("平局") + elif player=="石头"and computer=="剪刀": + print("恭喜,你赢了") + elif player=="剪刀"and computer=="布": + print("恭喜,你赢了) + elif player=="布"and computer=="石头": + print("恭喜你,你赢了") + else: + print("很遗憾,你输了") + else: + print("输错了!!!!") \ No newline at end of file diff --git a/jk.py b/jk.py index 16beadb..5c94330 100644 --- a/jk.py +++ b/jk.py @@ -1,10 +1,13 @@ -if player==computer: - print("平局") -elif player=="石头"and computer=="剪刀": - print("恭喜,你赢了") -elif player=="剪刀"and computer=="布": - print("恭喜,你赢了) -elif player=="布"and computer=="石头": - print("恭喜你,你赢了") -else: - print("很遗憾,你输了") \ No newline at end of file + if player in list + if player==computer + print("平局") + elif player=="石头"and computer=="剪刀": + print("恭喜,你赢了") + elif player=="剪刀"and computer=="布": + print("恭喜,你赢了) + elif player=="布"and computer=="石头": + print("恭喜你,你赢了") + else: + print("很遗憾,你输了") + else: + print("输错了!!!!") \ No newline at end of file -- libgit2 0.25.0