@@ -42,8 +42,8 @@ msgid ""
4242" that a secondary prompt on a line by itself in an example means you must "
4343"type a blank line; this is used to end a multi-line command."
4444msgstr ""
45- "在下面的例子中,通过是否存在提示符 ( :term:`>>>` 与 :term:`...`) "
46- "来区分输入与输出:如需复现这些例子,有提示符开头时,必须在提示符后键入例子中的每个词 ;未以提示符开头的行是解释器的输出。注意,例子中的某行出现第二个提示符时,意味着必须键入一个空白行; 这是用来结束多行命令的。"
45+ "下面的例子用是否显示提示符( :term:`>>>` 与 "
46+ ":term:`...`)区分输入与输出:输入例子代码时,对于以提示符开头的行,要键入提示符后的所有内容 ;未以提示符开头的行是解释器的输出。注意,例子中的某行出现第二个提示符时,意味着必须键入空白行, 这是用来结束多行命令的。"
4747
4848#: ../../tutorial/introduction.rst:16
4949msgid ""
@@ -56,16 +56,16 @@ msgid ""
5656"Python, they may be omitted when typing in examples."
5757msgstr ""
5858"本手册中的许多例子,甚至交互性命令中都包含注释。Python 注释以井号 ``#`` "
59- "开头,一直到该物理行结束。注释可以在一行开头,或在空白字符与代码之后 ,但不能在字符串里面。字符串中的井号就是井号。注释是用来阐明代码的 ,Python "
60- "不解释注释,在键入例子时,可以忽略注释 。"
59+ "开头,一直到该物理行结束。注释可以在一行开头,或空白字符与代码之后 ,但不能在字符串里面。字符串中的井号就是井号。注释用来阐明代码 ,Python "
60+ "不解释注释,因此,键入例子时,可以不输入注释 。"
6161
6262#: ../../tutorial/introduction.rst:24
6363msgid "Some examples::"
6464msgstr "几个例子:"
6565
6666#: ../../tutorial/introduction.rst:35
6767msgid "Using Python as a Calculator"
68- msgstr "Python 版计算器 "
68+ msgstr "Python 计算器 "
6969
7070#: ../../tutorial/introduction.rst:37
7171msgid ""
@@ -94,17 +94,17 @@ msgid ""
9494"ones with a fractional part (e.g. ``5.0``, ``1.6``) have type "
9595":class:`float`. We will see more about numeric types later in the tutorial."
9696msgstr ""
97- "整数(如,``2``、``4``、``20`` )的类型是 :class:`int`,有小数部分的 (如,``5.0``、``1.6`` )的类型是 "
98- ":class:`float`。在本教程后半部分将介绍更多的数字类型 。"
97+ "整数(如,``2``、``4``、``20`` )的类型是 :class:`int`,带小数 (如,``5.0``、``1.6`` )的类型是 "
98+ ":class:`float`。本教程后半部分将介绍更多数字类型 。"
9999
100100#: ../../tutorial/introduction.rst:65
101101msgid ""
102102"Division (``/``) always returns a float. To do :term:`floor division` and "
103103"get an integer result (discarding any fractional result) you can use the "
104104"``//`` operator; to calculate the remainder you can use ``%``::"
105105msgstr ""
106- "除法运算 ( ``/``) 总是返回浮点数类型 。用 ``//`` 运算符执行 :term:`floor division` "
107- "的结果是整数(忽略小数部分);计算余数,使用 ``%``:"
106+ "除法运算( ``/``)返回浮点数类型 。用 ``//`` 运算符执行 :term:`floor division` "
107+ "的结果是整数(忽略小数部分);计算余数用 ``%``:"
108108
109109#: ../../tutorial/introduction.rst:79
110110msgid ""
@@ -116,13 +116,13 @@ msgstr "Python 使用 ``**`` 运算符计算乘方 [#]_:"
116116msgid ""
117117"The equal sign (``=``) is used to assign a value to a variable. Afterwards, "
118118"no result is displayed before the next interactive prompt::"
119- msgstr "等号(``=``)用于给变量赋值。然后,在下一个交互提示符前,不会输出任何结果 :"
119+ msgstr "等号(``=``)用于给变量赋值。赋值后,不会在下一个交互提示符的位置显示任何结果 :"
120120
121121#: ../../tutorial/introduction.rst:94
122122msgid ""
123123"If a variable is not \" defined\" (assigned a value), trying to use it will "
124124"give you an error::"
125- msgstr "如果变量未定义(未赋值),使用该变量时会提示错误:"
125+ msgstr "如果变量未定义(即, 未赋值),使用该变量时会提示错误:"
126126
127127#: ../../tutorial/introduction.rst:102
128128msgid ""
@@ -167,7 +167,7 @@ msgid ""
167167"double quotes (``\" ...\" ``) with the same result [#]_. ``\\ `` can be used "
168168"to escape quotes::"
169169msgstr ""
170- "除了数字,Python 还可以操作字符串。字符串有多种表现形式,单引号 (``'……'``),双引号 (``\" ……\" ``)引起来的结果相同 "
170+ "除了数字,Python 还可以操作字符串。字符串有多种表现形式,用单引号 (``'……'``)或双引号 (``\" ……\" ``)标注的结果相同 "
171171"[#]_。反斜杠 ``\\ `` 用于转义:"
172172
173173#: ../../tutorial/introduction.rst:155
@@ -181,17 +181,15 @@ msgid ""
181181"readable output, by omitting the enclosing quotes and by printing escaped "
182182"and special characters::"
183183msgstr ""
184- "在交互式解释器中,输出的字符串外面会加上引号,特殊字符会使用反斜杠来转义。 "
185- "虽然有时这看起来会与输入不一样(外面所加的引号可能会改变),但两个字符串是相同的。 "
186- "如果字符串中有单引号而没有双引号,该字符串外将加双引号来表示,否则就加单引号。 :func:`print` "
187- "函数会生成可读性更强的输出,即略去两边的引号,并且打印出经过转义的特殊字符::"
184+ "交互式解释器中,输出的字符串外围会加注引号,特殊字符使用反斜杠转义。虽然,有时看起来会与输入不一样(外加的引号可能会改变),但两个字符串是相同的。如果字符串中有单引号而没有双引号,该字符串外将加注双引号,反之,则加注单引号。:func:`print`"
185+ " 函数可以生成可读性更强的输出,即,略去两边的引号,并且输出经过转义的特殊字符:"
188186
189187#: ../../tutorial/introduction.rst:175
190188msgid ""
191189"If you don't want characters prefaced by ``\\ `` to be interpreted as special"
192190" characters, you can use *raw strings* by adding an ``r`` before the first "
193191"quote::"
194- msgstr "如果你不希望前置了 ``\\ `` 的字符转义成特殊字符,可以使用 *原始字符串* 方式 ,在引号前添加 ``r`` 即可:: "
192+ msgstr "如果不希望前置 ``\\ `` 的字符转义成特殊字符,可以使用 *原始字符串*,在引号前添加 ``r`` 即可: "
195193
196194#: ../../tutorial/introduction.rst:185
197195msgid ""
@@ -200,78 +198,78 @@ msgid ""
200198"included in the string, but it's possible to prevent this by adding a ``\\ ``"
201199" at the end of the line. The following example::"
202200msgstr ""
203- "字符串字面值可以跨行连续输入。一种方式是用三重引号 :``\"\"\" ...\"\"\" `` 或 "
204- "``'''...'''``。字符串中的回车换行会自动包含到字符串中,如果不想包含,在行尾添加一个 ``\\ `` 即可。如下例:: "
201+ "字符串字面值可以跨行连续输入。实现方式是用三引号 :``\"\"\" ...\"\"\" `` 或 "
202+ "``'''...'''``,字符串行尾会自动加上回车换行,如果不需要回车换行,在行尾添加 ``\\ `` 即可。示例如下: "
205203
206204#: ../../tutorial/introduction.rst:196
207205msgid ""
208206"produces the following output (note that the initial newline is not "
209207"included):"
210- msgstr "将产生如下输出(注意最开始的换行没有包括进来):: "
208+ msgstr "输出如下(注意,第一行没有换行): "
211209
212210#: ../../tutorial/introduction.rst:204
213211msgid ""
214212"Strings can be concatenated (glued together) with the ``+`` operator, and "
215213"repeated with ``*``::"
216- msgstr "字符串可以用 ``+`` 进行连接 (粘到一起),也可以用 ``*`` 进行重复:: "
214+ msgstr "字符串可以用 ``+`` 连接 (粘到一起),也可以用 ``*`` 重复: "
217215
218216#: ../../tutorial/introduction.rst:211
219217msgid ""
220218"Two or more *string literals* (i.e. the ones enclosed between quotes) next "
221219"to each other are automatically concatenated. ::"
222- msgstr "相邻的两个或多个 *字符串字面值 * (引号引起来的字符)将会自动连接到一起. :: "
220+ msgstr "相邻的两个或多个 *字符串字面量 * (引号标注的字符)会自动合并: "
223221
224222#: ../../tutorial/introduction.rst:217
225223msgid ""
226224"This feature is particularly useful when you want to break long strings::"
227- msgstr "把很长的字符串拆开分别输入的时候尤其有用:: "
225+ msgstr "拆分长字符串时,这个功能特别实用: "
228226
229227#: ../../tutorial/introduction.rst:224
230228msgid ""
231229"This only works with two literals though, not with variables or "
232230"expressions::"
233- msgstr "只能对两个字面值这样操作,变量或表达式不行:: "
231+ msgstr "这项功能只能用于两个字面量,不能用于变量或表达式: "
234232
235233#: ../../tutorial/introduction.rst:238
236234msgid ""
237235"If you want to concatenate variables or a variable and a literal, use "
238236"``+``::"
239- msgstr "如果你想连接变量,或者连接变量和字面值,可以用 ``+`` 号:: "
237+ msgstr "合并多个变量,或合并变量与字面量,要用 ``+``: "
240238
241239#: ../../tutorial/introduction.rst:243
242240msgid ""
243241"Strings can be *indexed* (subscripted), with the first character having "
244242"index 0. There is no separate character type; a character is simply a string"
245243" of size one::"
246- msgstr "字符串是可以被 *索引* (下标访问)的,第一个字符索引是 0。单个字符并没有特殊的类型,只是一个长度为一的字符串:: "
244+ msgstr "字符串支持 *索引* (下标访问),第一个字符的索引是 0。没有单字符专用类型,单字符就是长度为一的字符串: "
247245
248246#: ../../tutorial/introduction.rst:253
249247msgid ""
250248"Indices may also be negative numbers, to start counting from the right::"
251- msgstr "索引也可以用负数,这种会从右边开始数:: "
249+ msgstr "索引还支持负数,用负数索引时,从右边开始计数: "
252250
253251#: ../../tutorial/introduction.rst:262
254252msgid "Note that since -0 is the same as 0, negative indices start from -1."
255- msgstr "注意 -0 和 0 是一样的,所以负数索引从 -1 开始。"
253+ msgstr "注意, -0 和 0 一样,因此,负数索引从 -1 开始。"
256254
257255#: ../../tutorial/introduction.rst:264
258256msgid ""
259257"In addition to indexing, *slicing* is also supported. While indexing is "
260258"used to obtain individual characters, *slicing* allows you to obtain "
261259"substring::"
262- msgstr "除了索引,字符串还支持 *切片*。索引可以得到单个字符,而 *切片* 可以获取子字符串:: "
260+ msgstr "除了索引,字符串还支持 *切片*。索引可以提取单个字符, *切片* 则提取子字符串: "
263261
264262#: ../../tutorial/introduction.rst:272
265263msgid ""
266264"Note how the start is always included, and the end always excluded. This "
267265"makes sure that ``s[:i] + s[i:]`` is always equal to ``s``::"
268- msgstr "注意切片的开始总是被包括在结果中,而结束不被包括。这使得 ``s[:i] + s[i:]`` 总是等于 ``s`` :: "
266+ msgstr "注意,输出结果总是包含切片开始,但不包含切片结束。因此, ``s[:i] + s[i:]`` 总是等于 ``s``: "
269267
270268#: ../../tutorial/introduction.rst:280
271269msgid ""
272270"Slice indices have useful defaults; an omitted first index defaults to zero,"
273271" an omitted second index defaults to the size of the string being sliced. ::"
274- msgstr "切片的索引有默认值;省略开始索引时默认为0,省略结束索引时默认为到字符串的结束:: "
272+ msgstr "切片索引的默认值很有用;省略开始索引时,默认值为 0,省略结束索引时,默认为到字符串的结尾: "
275273
276274#: ../../tutorial/introduction.rst:290
277275msgid ""
@@ -280,7 +278,8 @@ msgid ""
280278"Then the right edge of the last character of a string of *n* characters has "
281279"index *n*, for example::"
282280msgstr ""
283- "您也可以这么理解切片:将索引视作指向字符 *之间* ,第一个字符的左侧标为0,最后一个字符的右侧标为 *n* ,其中 *n* 是字符串长度。例如::"
281+ "还可以这样理解切片的运作方式,索引指向的是字符 *之间* ,第一个字符的左侧标为 0,最后一个字符的右侧标为 *n* ,其中,*n* "
282+ "是字符串长度。例如:"
284283
285284#: ../../tutorial/introduction.rst:301
286285msgid ""
@@ -442,12 +441,12 @@ msgid ""
442441"`Fibonacci series <https://en.wikipedia.org/wiki/Fibonacci_number>`_ as "
443442"follows::"
444443msgstr ""
445- "当然,我们可以将 Python 用于更复杂的任务,而不是仅仅两个和两个一起添加 。 例如,我们可以编写 `斐波那契数列 "
446- "<https://en.wikipedia.org/wiki/Fibonacci_number>`_ 的初始子序列,如下所示:: "
444+ "当然,Python 还可以完成更复杂的任务,不仅仅是二加二 。 例如,可以编写 `斐波那契数列 "
445+ "<https://en.wikipedia.org/wiki/Fibonacci_number>`_ 的初始子序列,如下所示: "
447446
448447#: ../../tutorial/introduction.rst:489
449448msgid "This example introduces several new features."
450- msgstr "这个例子引入了几个新的特点 。"
449+ msgstr "本例引入了几个新功能 。"
451450
452451#: ../../tutorial/introduction.rst:491
453452msgid ""
0 commit comments