Merge pull request from inkydragon/py3-zh-cn-fix

[Python3/zh-cn] fix typo
This commit is contained in:
Divay Prakash 2018-09-11 23:19:44 +05:30 committed by GitHub
commit a15ad34efc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,13 +10,13 @@ filename: learnpython3-cn.py
lang: zh-cn
---
Python是由吉多·范罗苏姆(Guido Van Rossum)在90年代早期设计。它是如今最常用的编程
语言之一。它的语法简洁且优美,几乎就是可执行的伪代码。
Python 是由吉多·范罗苏姆(Guido Van Rossum)在 90 年代早期设计。
它是如今最常用的编程语言之一。它的语法简洁且优美,几乎就是可执行的伪代码。
欢迎大家斧正。英文版原作 Louie Dinh [@louiedinh](http://twitter.com/louiedinh)
或着Email louiedinh [at] [谷歌的信箱服务]。中文翻译Geoff Liu。
邮箱 louiedinh [at] [谷歌的信箱服务]。中文翻译 Geoff Liu。
注意:这篇教程是特别为Python3写的。如果你想学旧版Python2我们特别有另一篇教程
注意:这篇教程是基于 Python 3 写的。如果你想学旧版 Python 2我们特别有[另一篇教程](http://learnxinyminutes.com/docs/python/)
```python
@ -116,7 +116,8 @@ False or True #=> True
# => "Jack be nimble, Jack be quick, Jack jump over the candle stick"
# 如果不想数参数,可以用关键字
"{name} wants to eat {food}".format(name="Bob", food="lasagna") #=> "Bob wants to eat lasagna"
"{name} wants to eat {food}".format(name="Bob", food="lasagna")
# => "Bob wants to eat lasagna"
# 如果你的Python3程序也要在Python2.5以下环境运行,也可以用老式的格式化语法
"%s can be %s the %s way" % ("strings", "interpolated", "old")
@ -233,7 +234,8 @@ filled_dict = {"one": 1, "two": 2, "three": 3}
filled_dict["one"] # => 1
# 用keys获得所有的键。因为keys返回一个可迭代对象所以在这里把结果包在list里。我们下面会详细介绍可迭代。
# 用 keys 获得所有的键。
# 因为 keys 返回一个可迭代对象,所以在这里把结果包在 list 里。我们下面会详细介绍可迭代。
# 注意:字典键的顺序是不定的,你得到的结果可能和以下不同。
list(filled_dict.keys()) # => ["three", "two", "one"]
@ -362,7 +364,7 @@ else: # else语句是可选的必须在所有的except之后
filled_dict = {"one": 1, "two": 2, "three": 3}
our_iterable = filled_dict.keys()
print(our_iterable) # => range(1,10) 是一个实现可迭代接口的对象
print(our_iterable) # => dict_keys(['one', 'two', 'three'])是一个实现可迭代接口的对象
# 可迭代对象可以遍历
for i in our_iterable: