@@ -125,7 +125,7 @@ msgid ""
125
125
"window 6\n"
126
126
"defenestrate 12"
127
127
msgstr ""
128
- ">>> # Measure some strings: \n"
128
+ ">>> # 測量一些字串: \n"
129
129
">>> words = ['cat', 'window', 'defenestrate']\n"
130
130
">>> for w in words:\n"
131
131
"... print(w, len(w))\n"
@@ -162,7 +162,7 @@ msgstr ""
162
162
"# 建立一個範例集合\n"
163
163
"users = {'Hans': 'active', 'Éléonore': 'inactive', '景太郎': 'active'}\n"
164
164
"\n"
165
- "# 策略:對副本進行迭代 \n"
165
+ "# 策略:對副本進行疊代 \n"
166
166
"for user, status in users.copy().items():\n"
167
167
" if status == 'inactive':\n"
168
168
" del users[user]\n"
@@ -470,7 +470,7 @@ msgstr ""
470
470
"... print(n, 'equals', x, '*', n//x)\n"
471
471
"... break\n"
472
472
"... else:\n"
473
- "... # loop fell through without finding a factor \n"
473
+ "... # 迴圈結束但沒有找到因數 \n"
474
474
"... print(n, 'is a prime number')\n"
475
475
"...\n"
476
476
"2 is a prime number\n"
@@ -536,7 +536,7 @@ msgid ""
536
536
"..."
537
537
msgstr ""
538
538
">>> while True:\n"
539
- "... pass # Busy-wait for keyboard interrupt (Ctrl+C)\n"
539
+ "... pass # 忙碌等待鍵盤中斷 (Ctrl+C)\n"
540
540
"..."
541
541
542
542
#: ../../tutorial/controlflow.rst:266
@@ -570,7 +570,7 @@ msgid ""
570
570
"..."
571
571
msgstr ""
572
572
">>> def initlog(*args):\n"
573
- "... pass # Remember to implement this! \n"
573
+ "... pass # 記得要實作這個! \n"
574
574
"..."
575
575
576
576
#: ../../tutorial/controlflow.rst:284
@@ -667,7 +667,7 @@ msgid ""
667
667
" case _:\n"
668
668
" raise ValueError(\" Not a point\" )"
669
669
msgstr ""
670
- "# point is an (x, y) tuple \n"
670
+ "# point 是一個 (x, y) 元組 \n"
671
671
"match point:\n"
672
672
" case (0, 0):\n"
673
673
" print(\" Origin\" )\n"
@@ -987,15 +987,15 @@ msgid ""
987
987
">>> fib(2000)\n"
988
988
"0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597"
989
989
msgstr ""
990
- ">>> def fib(n): # write Fibonacci series less than n \n"
991
- "... \"\"\" Print a Fibonacci series less than n. \"\"\" \n"
990
+ ">>> def fib(n): # 寫出小於 n 的費氏數列 \n"
991
+ "... \"\"\" 印出小於 n 的費氏數列。 \"\"\" \n"
992
992
"... a, b = 0, 1\n"
993
993
"... while a < n:\n"
994
994
"... print(a, end=' ')\n"
995
995
"... a, b = b, a+b\n"
996
996
"... print()\n"
997
997
"...\n"
998
- ">>> # Now call the function we just defined: \n"
998
+ ">>> # 現在呼叫我們剛才定義的函式: \n"
999
999
">>> fib(2000)\n"
1000
1000
"0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597"
1001
1001
@@ -1131,17 +1131,17 @@ msgid ""
1131
1131
">>> f100 # write the result\n"
1132
1132
"[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]"
1133
1133
msgstr ""
1134
- ">>> def fib2(n): # return Fibonacci series up to n \n"
1135
- "... \"\"\" Return a list containing the Fibonacci series up to n. \"\"\" \n"
1134
+ ">>> def fib2(n): # 回傳到 n 為止的費氏數列 \n"
1135
+ "... \"\"\" 回傳包含到 n 為止的費氏數列的列表。 \"\"\" \n"
1136
1136
"... result = []\n"
1137
1137
"... a, b = 0, 1\n"
1138
1138
"... while a < n:\n"
1139
- "... result.append(a) # see below \n"
1139
+ "... result.append(a) # 見下方 \n"
1140
1140
"... a, b = b, a+b\n"
1141
1141
"... return result\n"
1142
1142
"...\n"
1143
- ">>> f100 = fib2(100) # call it \n"
1144
- ">>> f100 # write the result \n"
1143
+ ">>> f100 = fib2(100) # 呼叫它 \n"
1144
+ ">>> f100 # 寫出結果 \n"
1145
1145
"[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]"
1146
1146
1147
1147
#: ../../tutorial/controlflow.rst:550
@@ -1401,9 +1401,9 @@ msgid ""
1401
1401
msgstr ""
1402
1402
"parrot(1000) # 1 positional "
1403
1403
"argument\n"
1404
- "parrot(voltage=1000) # 1 keyword argument \n"
1405
- "parrot(voltage=1000000, action='VOOOOOM') # 2 keyword arguments \n"
1406
- "parrot(action='VOOOOOM', voltage=1000000) # 2 keyword arguments \n"
1404
+ "parrot(voltage=1000) # 1 個關鍵字引數 \n"
1405
+ "parrot(voltage=1000000, action='VOOOOOM') # 2 個關鍵字引數 \n"
1406
+ "parrot(action='VOOOOOM', voltage=1000000) # 2 個關鍵字引數 \n"
1407
1407
"parrot('a million', 'bereft of life', 'jump') # 3 positional "
1408
1408
"arguments\n"
1409
1409
"parrot('a thousand', state='pushing up the daisies') # 1 positional, 1 "
@@ -1421,11 +1421,11 @@ msgid ""
1421
1421
"parrot(110, voltage=220) # duplicate value for the same argument\n"
1422
1422
"parrot(actor='John Cleese') # unknown keyword argument"
1423
1423
msgstr ""
1424
- "parrot() # required argument missing \n"
1424
+ "parrot() # 缺少必要引數 \n"
1425
1425
"parrot(voltage=5.0, 'dead') # non-keyword argument after a keyword "
1426
1426
"argument\n"
1427
- "parrot(110, voltage=220) # duplicate value for the same argument \n"
1428
- "parrot(actor='John Cleese') # unknown keyword argument "
1427
+ "parrot(110, voltage=220) # 同一個引數有重複值 \n"
1428
+ "parrot(actor='John Cleese') # 未知的關鍵字引數 "
1429
1429
1430
1430
#: ../../tutorial/controlflow.rst:684
1431
1431
msgid ""
@@ -1989,7 +1989,7 @@ msgid ""
1989
1989
"list\n"
1990
1990
"[3, 4, 5]"
1991
1991
msgstr ""
1992
- ">>> list(range(3, 6)) # normal call with separate arguments \n"
1992
+ ">>> list(range(3, 6)) # 使用分離引數的一般呼叫 \n"
1993
1993
"[3, 4, 5]\n"
1994
1994
">>> args = [3, 6]\n"
1995
1995
">>> list(range(*args)) # call with arguments unpacked from a "
@@ -2160,9 +2160,9 @@ msgid ""
2160
2160
"No, really, it doesn't do anything."
2161
2161
msgstr ""
2162
2162
">>> def my_function():\n"
2163
- "... \"\"\" Do nothing, but document it. \n"
2163
+ "... \"\"\" 不做任何事,但有文件說明。 \n"
2164
2164
"...\n"
2165
- "... No, really, it doesn't do anything. \n"
2165
+ "... 不,真的,它什麼都不做。 \n"
2166
2166
"... \"\"\" \n"
2167
2167
"... pass\n"
2168
2168
"...\n"
0 commit comments