@@ -221,7 +221,7 @@ msgid ""
221
221
" File \" <stdin>\" , line 1, in <module>\n"
222
222
"NameError: name 'n' is not defined"
223
223
msgstr ""
224
- ">>> n # try to access an undefined variable \n"
224
+ ">>> n # 嘗試存取未定義的變數 \n"
225
225
"Traceback (most recent call last):\n"
226
226
" File \" <stdin>\" , line 1, in <module>\n"
227
227
"NameError: name 'n' is not defined"
@@ -319,11 +319,11 @@ msgid ""
319
319
">>> '1975' # digits and numerals enclosed in quotes are also strings\n"
320
320
"'1975'"
321
321
msgstr ""
322
- ">>> 'spam eggs' # single quotes \n"
322
+ ">>> 'spam eggs' # 單引號 \n"
323
323
"'spam eggs'\n"
324
- ">>> \" Paris rabbit got your back :)! Yay!\" # double quotes \n"
324
+ ">>> \" Paris rabbit got your back :)! Yay!\" # 雙引號 \n"
325
325
"'Paris rabbit got your back :)! Yay!'\n"
326
- ">>> '1975' # digits and numerals enclosed in quotes are also strings \n"
326
+ ">>> '1975' # 以引號包含的數字和數值也是字串 \n"
327
327
"'1975'"
328
328
329
329
#: ../../tutorial/introduction.rst:158
@@ -349,7 +349,7 @@ msgid ""
349
349
msgstr ""
350
350
">>> 'doesn\\ 't' # use \\ ' to escape the single quote...\n"
351
351
"\" doesn't\" \n"
352
- ">>> \" doesn't\" # ...or use double quotes instead \n"
352
+ ">>> \" doesn't\" # ...或改用雙引號 \n"
353
353
"\" doesn't\" \n"
354
354
">>> '\" Yes,\" they said.'\n"
355
355
"'\" Yes,\" they said.'\n"
@@ -378,8 +378,8 @@ msgid ""
378
378
"First line.\n"
379
379
"Second line."
380
380
msgstr ""
381
- ">>> s = 'First line.\\ nSecond line.' # \\ n means newline \n"
382
- ">>> s # without print(), special characters are included in the string \n"
381
+ ">>> s = 'First line.\\ nSecond line.' # \\ n 表示換行 \n"
382
+ ">>> s # 沒有 print(),特殊字元會包含在字串中 \n"
383
383
"'First line.\\ nSecond line.'\n"
384
384
">>> print(s) # with print(), special characters are interpreted, so \\ n "
385
385
"produces new line\n"
@@ -403,10 +403,10 @@ msgid ""
403
403
">>> print(r'C:\\ some\\ name') # note the r before the quote\n"
404
404
"C:\\ some\\ name"
405
405
msgstr ""
406
- ">>> print('C:\\ some\\ name') # here \\ n means newline! \n"
406
+ ">>> print('C:\\ some\\ name') # 這裡 \\ n 表示換行! \n"
407
407
"C:\\ some\n"
408
408
"ame\n"
409
- ">>> print(r'C:\\ some\\ name') # note the r before the quote \n"
409
+ ">>> print(r'C:\\ some\\ name') # 注意引號前的 r \n"
410
410
"C:\\ some\\ name"
411
411
412
412
#: ../../tutorial/introduction.rst:193
@@ -468,7 +468,7 @@ msgid ""
468
468
">>> 3 * 'un' + 'ium'\n"
469
469
"'unununium'"
470
470
msgstr ""
471
- ">>> # 3 times 'un', followed by 'ium'\n"
471
+ ">>> # 3 次 'un',接著是 'ium'\n"
472
472
">>> 3 * 'un' + 'ium'\n"
473
473
"'unununium'"
474
474
@@ -526,7 +526,7 @@ msgid ""
526
526
"SyntaxError: invalid syntax"
527
527
msgstr ""
528
528
">>> prefix = 'Py'\n"
529
- ">>> prefix 'thon' # can't concatenate a variable and a string literal \n"
529
+ ">>> prefix 'thon' # 無法串接變數和字串字面值 \n"
530
530
" File \" <stdin>\" , line 1\n"
531
531
" prefix 'thon'\n"
532
532
" ^^^^^^\n"
@@ -568,9 +568,9 @@ msgid ""
568
568
"'n'"
569
569
msgstr ""
570
570
">>> word = 'Python'\n"
571
- ">>> word[0] # character in position 0 \n"
571
+ ">>> word[0] # 位置 0 的字元 \n"
572
572
"'P'\n"
573
- ">>> word[5] # character in position 5 \n"
573
+ ">>> word[5] # 位置 5 的字元 \n"
574
574
"'n'"
575
575
576
576
#: ../../tutorial/introduction.rst:264
@@ -587,9 +587,9 @@ msgid ""
587
587
">>> word[-6]\n"
588
588
"'P'"
589
589
msgstr ""
590
- ">>> word[-1] # last character \n"
590
+ ">>> word[-1] # 最後一個字元 \n"
591
591
"'n'\n"
592
- ">>> word[-2] # second-last character \n"
592
+ ">>> word[-2] # 倒數第二個字元 \n"
593
593
"'o'\n"
594
594
">>> word[-6]\n"
595
595
"'P'"
@@ -614,9 +614,9 @@ msgid ""
614
614
">>> word[2:5] # characters from position 2 (included) to 5 (excluded)\n"
615
615
"'tho'"
616
616
msgstr ""
617
- ">>> word[0:2] # characters from position 0 (included) to 2 (excluded) \n"
617
+ ">>> word[0:2] # 從位置 0 (包含) 到 2 (不包含) 的字元 \n"
618
618
"'Py'\n"
619
- ">>> word[2:5] # characters from position 2 (included) to 5 (excluded) \n"
619
+ ">>> word[2:5] # 從位置 2 (包含) 到 5 (不包含) 的字元 \n"
620
620
"'tho'"
621
621
622
622
#: ../../tutorial/introduction.rst:283
@@ -636,11 +636,11 @@ msgid ""
636
636
">>> word[-2:] # characters from the second-last (included) to the end\n"
637
637
"'on'"
638
638
msgstr ""
639
- ">>> word[:2] # character from the beginning to position 2 (excluded) \n"
639
+ ">>> word[:2] # 從開頭到位置 2 (不包含) 的字元 \n"
640
640
"'Py'\n"
641
- ">>> word[4:] # characters from position 4 (included) to the end \n"
641
+ ">>> word[4:] # 從位置 4 (包含) 到結尾的字元 \n"
642
642
"'on'\n"
643
- ">>> word[-2:] # characters from the second-last (included) to the end \n"
643
+ ">>> word[-2:] # 從倒數第二個 (包含) 到結尾的字元 \n"
644
644
"'on'"
645
645
646
646
#: ../../tutorial/introduction.rst:293
@@ -889,11 +889,11 @@ msgid ""
889
889
">>> squares[-3:] # slicing returns a new list\n"
890
890
"[9, 16, 25]"
891
891
msgstr ""
892
- ">>> squares[0] # indexing returns the item \n"
892
+ ">>> squares[0] # 索引回傳項目 \n"
893
893
"1\n"
894
894
">>> squares[-1]\n"
895
895
"25\n"
896
- ">>> squares[-3:] # slicing returns a new list \n"
896
+ ">>> squares[-3:] # 切片回傳新列表 \n"
897
897
"[9, 16, 25]"
898
898
899
899
#: ../../tutorial/introduction.rst:407
@@ -925,10 +925,10 @@ msgid ""
925
925
">>> cubes\n"
926
926
"[1, 8, 27, 64, 125]"
927
927
msgstr ""
928
- ">>> cubes = [1, 8, 27, 65, 125] # something's wrong here \n"
929
- ">>> 4 ** 3 # the cube of 4 is 64, not 65! \n"
928
+ ">>> cubes = [1, 8, 27, 65, 125] # 這裡有問題 \n"
929
+ ">>> 4 ** 3 # 4 的立方是 64,不是 65! \n"
930
930
"64\n"
931
- ">>> cubes[3] = 64 # replace the wrong value \n"
931
+ ">>> cubes[3] = 64 # 替換錯誤的值 \n"
932
932
">>> cubes\n"
933
933
"[1, 8, 27, 64, 125]"
934
934
@@ -947,8 +947,8 @@ msgid ""
947
947
">>> cubes\n"
948
948
"[1, 8, 27, 64, 125, 216, 343]"
949
949
msgstr ""
950
- ">>> cubes.append(216) # add the cube of 6 \n"
951
- ">>> cubes.append(7 ** 3) # and the cube of 7 \n"
950
+ ">>> cubes.append(216) # 加入 6 的立方 \n"
951
+ ">>> cubes.append(7 ** 3) # 以及 7 的立方 \n"
952
952
">>> cubes\n"
953
953
"[1, 8, 27, 64, 125, 216, 343]"
954
954
0 commit comments