diff options
author | Boris Verkhovskiy <boris.verk@gmail.com> | 2024-04-03 04:31:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-03 04:31:13 -0700 |
commit | fbf132752b743d0f43c3395da0699bee53da22df (patch) | |
tree | 56da43c86e1aebd24e3913b405e21d6f2812e9a3 /zh-cn/python-cn.html.markdown | |
parent | 247dc6e86c1421fa031e4b61c42c05ca6e09bfb0 (diff) | |
parent | c166f2acb295627c5ae305a6dd517a27ca8fece6 (diff) |
Merge branch 'master' into patch-1
Diffstat (limited to 'zh-cn/python-cn.html.markdown')
-rw-r--r-- | zh-cn/python-cn.html.markdown | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/zh-cn/python-cn.html.markdown b/zh-cn/python-cn.html.markdown index a4e53c1b..127f7ad5 100644 --- a/zh-cn/python-cn.html.markdown +++ b/zh-cn/python-cn.html.markdown @@ -552,7 +552,7 @@ next(our_iterator) # => "three" # 当迭代器所有元素都取出后,会抛出 StopIteration next(our_iterator) # 抛出 StopIteration -# 我们可以通过遍历还访问所有的值,实际上,for 内部实现了迭代 +# 我们还可以通过遍历访问所有的值,实际上,for 内部实现了迭代 our_iterator = iter(our_iterable) for i in our_iterator: print(i) # 依次打印 one, two, three @@ -697,7 +697,7 @@ import math dir(math) # 当你的脚本文件所在的文件夹也包含了一个名为 math.py 的 Python 文件 -# 这个 math.p 文件会被代替引入,而不是引入 Python 內建模块中的 math +# 这个 math.py 文件会被代替引入,而不是引入 Python 內建模块中的 math # 出现这个情况的原因是本地文件夹的引入优先级要比 Python 內建库引入优先级要高 @@ -760,7 +760,7 @@ class Human: del self._age # 当 Python 解释器在读取源文件的时候,就会执行文件中所有的代码 -# 对 __name__ 的检查可以保证这块代码只会在执行这个模块是住程序情况下被运行(而不是在引用时运行) +# 对 __name__ 的检查可以保证这块代码只会在这个模块是主程序的情况下被运行(而不是在引用时运行) if __name__ == '__main__': # i = Human(name="Ian") |