From e67e21e9556f5657175084da017326dd07932147 Mon Sep 17 00:00:00 2001 From: johnzan0743 <65598659+johnzan0743@users.noreply.github.com> Date: Mon, 1 Jun 2020 13:29:44 +1000 Subject: [PATCH] =?UTF-8?q?Update=2005.=E6=9E=84=E9=80=A0=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E9=80=BB=E8=BE=91.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit debt should be bet --- Day01-15/05.构造程序逻辑.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Day01-15/05.构造程序逻辑.md b/Day01-15/05.构造程序逻辑.md index 075583c..4957369 100644 --- a/Day01-15/05.构造程序逻辑.md +++ b/Day01-15/05.构造程序逻辑.md @@ -85,17 +85,17 @@ print('你的总资产为:', money) needs_go_on = False while True: - debt = int(input('请下注: ')) - if 0 < debt <= money: + bet = int(input('请下注: ')) + if 0 < bet <= money: break first = randint(1, 6) + randint(1, 6) print('玩家摇出了%d点' % first) if first == 7 or first == 11: print('玩家胜!') - money += debt + money += bet elif first == 2 or first == 3 or first == 12: print('庄家胜!') - money -= debt + money -= bet else: needs_go_on = True while needs_go_on: @@ -104,10 +104,10 @@ print('玩家摇出了%d点' % current) if current == 7: print('庄家胜') - money -= debt + money -= bet elif current == first: print('玩家胜') - money += debt + money += bet else: needs_go_on = True print('你破产了, 游戏结束!') @@ -127,4 +127,4 @@ > **说明**:素数指的是只能被1和自身整除的正整数(不包括1)。 -上面练习的参考答案在本章对应的代码目录中,如果需要帮助请读者自行查看参考答案。 \ No newline at end of file +上面练习的参考答案在本章对应的代码目录中,如果需要帮助请读者自行查看参考答案。