Merge pull request #28 from rrdssfgcs/patch-1

FIX: 修正了一个小错误。
master
xianhu 2018-03-21 00:08:10 +08:00 committed by GitHub
commit 720f90701d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -369,7 +369,7 @@
A = 1 if X else (2 if Y else 3) A = 1 if X else (2 if Y else 3)
# 也可以使用and-or语句一条语句实现多个if-else # 也可以使用and-or语句一条语句实现多个if-else
a = 6 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语句 #-- Python的while语句或者for语句可以带else语句 当然也可以带continue/break/pass语句
while a > 1: while a > 1: