From a4f00ef720a249384ee023afa124968ce1360cd5 Mon Sep 17 00:00:00 2001 From: ducheng Date: Tue, 27 Nov 2018 14:49:03 +0800 Subject: [PATCH] EX.Yes, it exists --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5f1e860..9f6de10 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ So, here we go... - [> Brace yourself!/做好思想准备 *](#-brace-yourself做好思想准备-) - [> Let's meet Friendly Language Uncle For Life/让生活更友好 *](#-lets-meet-friendly-language-uncle-for-life让生活更友好-) - [> Even Python understands that love is complicated/连Python也知道爱是难言的 *](#-even-python-understands-that-love-is-complicated连Python也知道爱是难言的-) - - [> Yes, it exists!](#-yes-it-exists) + - [> Yes, it exists!/是的, 它存在!](#-yes-it-exists是的-它存在) - [> Inpinity *](#-inpinity-) - [> Mangling time! *](#-mangling-time-) - [Section: Miscellaneous](#section-miscellaneous) @@ -2073,9 +2073,9 @@ True --- -### > Yes, it exists! +### > Yes, it exists!/是的, 它存在! -**The `else` clause for loops.** One typical example might be: +**循环的 `else`.** 一个典型的例子: ```py def does_exists_num(l, to_find): @@ -2096,7 +2096,7 @@ Exists! Does not exist ``` -**The `else` clause in exception handling.** An example, +**异常的 `else` .** 例, ```py try: @@ -2112,9 +2112,9 @@ else: Try block executed successfully... ``` -#### 💡 Explanation: -- The `else` clause after a loop is executed only when there's no explicit `break` after all the iterations. -- `else` clause after try block is also called "completion clause" as reaching the `else` clause in a `try` statement means that the try block actually completed successfully. +#### 💡 说明: +- 循环后的 `else` 子句只会在循环没有触发 `break` 语句, 正常结束的情况下才会执行. +- try 之后的 `else` 子句也被称为 "完成子句", 因为在 `try` 语句中到达 `else` 子句意味着try块实际上已成功完成. ---