summaryrefslogtreecommitdiffhomepage
path: root/zh-cn
diff options
context:
space:
mode:
authorGeoff Liu <cangming.liu@gmail.com>2014-10-31 16:01:10 -0600
committerGeoff Liu <cangming.liu@gmail.com>2014-10-31 16:01:10 -0600
commitfb89673ef1063c3446462d3249246929d492ea76 (patch)
tree804bfac14c1ecc61d9a11f00370cbf2392d59eb7 /zh-cn
parent2444690e5fae22d5f09f3f4966996785353fd3af (diff)
Minor changes
Diffstat (limited to 'zh-cn')
-rw-r--r--zh-cn/python3-cn.html.markdown12
1 files changed, 6 insertions, 6 deletions
diff --git a/zh-cn/python3-cn.html.markdown b/zh-cn/python3-cn.html.markdown
index efdfc158..6ad23600 100644
--- a/zh-cn/python3-cn.html.markdown
+++ b/zh-cn/python3-cn.html.markdown
@@ -148,8 +148,8 @@ print("I'm Python. Nice to meet you!")
some_var = 5
some_var # => 5
-# 存取未赋值的变量会抛出异常
-# 下面流程控制一段更深入讲解异常处理
+# 访问未赋值的变量会抛出异常
+# 参考流程控制一段来学习异常处理
some_unknown_var # 抛出NameError
# 用列表(list)储存序列
@@ -167,22 +167,22 @@ li.pop() # => 3 且li现在是[1, 2, 4]
# 把3再放回去
li.append(3) # li变回[1, 2, 4, 3]
-# 列表取值跟数组一样
+# 列表存取跟数组一样
li[0] # => 1
# 取出最后一个元素
li[-1] # => 3
-# 越界读取会造成IndexError
+# 越界存取会造成IndexError
li[4] # 抛出IndexError
-# 列表的切割语法
+# 列表有切割语法
# (It's a closed/open range for you mathy types.)
li[1:3] # => [2, 4]
# 取尾
li[2:] # => [4, 3]
# 取头
li[:3] # => [1, 2, 4]
-# 每两个取一个
+# 隔一个取一个
li[::2] # =>[1, 4]
# 倒排列表
li[::-1] # => [3, 4, 2, 1]