From a0e8ed1b0827c0da06ed8ba5fe3eadb25dbb929a Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sun, 10 Jan 2021 15:39:18 +0800 Subject: [PATCH] save project --- diy1.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/diy1.py b/diy1.py index babdd25..2f3a9bd 100644 --- a/diy1.py +++ b/diy1.py @@ -1,13 +1,17 @@ # 玩家出拳 + player = input("请出拳石头/剪刀/布:") print("玩家出拳:" + player) import random list=["石头","剪刀","布"] computer=ramdon.choice(list) print(computer) -if (player=="剪刀"and computer=="剪刀")or(player=="剪刀"and computer=="布")or(player=="布"and computer=="石头"): - print("sb,你赢啦") -elif player==computer: - print("sb,平局") +if player in list: + if (player=="剪刀"and computer=="剪刀")or(player=="剪刀"and computer=="布")or(player=="布"and computer=="石头"): + print("sb,你赢啦") + elif player==computer: + print("sb,平局") + else: + print("sb,你输啦") else: - print("sb,你输啦") \ No newline at end of file + print("sb,输错啦") \ No newline at end of file -- libgit2 0.25.0