From db2713da1327970d41d8c8144601cc8dac04d553 Mon Sep 17 00:00:00 2001 From: rrdssfgcs Date: Sat, 24 Feb 2018 10:51:17 +0800 Subject: [PATCH] =?UTF-8?q?FIX:=20=E4=BF=AE=E6=AD=A3=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=B0=8F=E9=94=99=E8=AF=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_base.py b/python_base.py index d11c543..ebd6999 100644 --- a/python_base.py +++ b/python_base.py @@ -369,7 +369,7 @@ A = 1 if X else (2 if Y else 3) # 也可以使用and-or语句(一条语句实现多个if-else) a = 6 - result = (a > 20 and "big than 20" or a > 10 and "big than 10" or a > 5 and "big than 5") # 返回"big than 20" + result = (a > 20 and "big than 20" or a > 10 and "big than 10" or a > 5 and "big than 5") # 返回"big than 5" #-- Python的while语句或者for语句可以带else语句 当然也可以带continue/break/pass语句 while a > 1: