@@ -13,7 +13,7 @@ msgstr ""
13
13
"Project-Id-Version : Python 3.5 TW\n "
14
14
"Report-Msgid-Bugs-To : \n "
15
15
"POT-Creation-Date : 2016-01-31 15:04+0800\n "
16
- "PO-Revision-Date : 2016-07-12 12:39 +0000\n "
16
+ "PO-Revision-Date : 2016-07-13 14:47 +0000\n "
17
17
"
Last-Translator :
Kent Hsu <[email protected] >\n "
18
18
"Language-Team : Chinese Traditional (http://www.transifex.com/python-tw-doc/python-35-tw/language/zh-Hant/)\n "
19
19
"MIME-Version : 1.0\n "
@@ -387,7 +387,7 @@ msgid ""
387
387
"cannot be used as a key. You can't use lists as keys, since lists can be "
388
388
"modified in place using index assignments, slice assignments, or methods "
389
389
"like :meth:`append` and :meth:`extend`."
390
- msgstr ""
390
+ msgstr "下一個常用的 python 內建資料結構為 *dictionary* (請參考 :ref:`typesmapping` )。 Dictionary 有時被稱為 \" 關聯記憶體 \" (associative memories) 或 \" 關聯矩陣 \" (associative arrays) 。不像序列是由一個範圍內的數字當作索引, dictionary 是由 *key* (鍵)來當索引, key 可以是任何不可變的型態;字串和數字都可以當作 key 。 Tuple 也可以當作 key 如果他們只含有字串、數字或 tuple;若一個 tuple 直接或間接地含有任何可變的物件,它就不能當作 key 。我們無法使用 list 當作 key ,因為 list 可以經由索引操作、切片操作或是方法像是 :meth:`append` 和 :meth:`extend` 來修改。 "
391
391
392
392
#: ../../tutorial/datastructures.rst:497
393
393
msgid ""
@@ -397,7 +397,7 @@ msgid ""
397
397
" comma-separated list of key:value pairs within the braces adds initial "
398
398
"key:value pairs to the dictionary; this is also the way dictionaries are "
399
399
"written on output."
400
- msgstr ""
400
+ msgstr "思考 dict 最好的方式是把它想成是一組無序的鍵值對 (*key: value* pair) 的集合,其中 key 必須是獨一無二的(在一個 dictionary 裡)。使用一對大括號可以創建一個空的 dict :``{}`` 。把一串由逗號分隔的鍵值對放置於大括號內可以為 dict 提供初始的鍵值對,這也是 dict 輸出時的樣子。 "
401
401
402
402
#: ../../tutorial/datastructures.rst:503
403
403
msgid ""
@@ -406,15 +406,15 @@ msgid ""
406
406
"key:value pair with ``del``. If you store using a key that is already in "
407
407
"use, the old value associated with that key is forgotten. It is an error to"
408
408
" extract a value using a non-existent key."
409
- msgstr ""
409
+ msgstr "Dict 主要的操作為藉由鍵來儲存一個值並且可藉由該鍵來取出該值。也可以使用 ``del`` 來刪除鍵值對。如果我們使用用過的鍵來儲存,該鍵所對應的較舊的值會被覆蓋。使用不存在的鍵來取出值會造成錯誤。 "
410
410
411
411
#: ../../tutorial/datastructures.rst:509
412
412
msgid ""
413
413
"Performing ``list(d.keys())`` on a dictionary returns a list of all the keys"
414
414
" used in the dictionary, in arbitrary order (if you want it sorted, just use"
415
415
" ``sorted(d.keys())`` instead). [2]_ To check whether a single key is in "
416
416
"the dictionary, use the :keyword:`in` keyword."
417
- msgstr ""
417
+ msgstr "對 dict 使用 ``list(d.keys())`` 會得到一個含有該 dict 所有鍵,順序為任意排列的 list 。(如果想要排序過的,使用 ``sorted(d.keys())`` 代替即可) [2]_ 要確認一個鍵是否已經存在於 dict 中,使用 keyword:`in` 關鍵字。 "
418
418
419
419
#: ../../tutorial/datastructures.rst:514
420
420
msgid "Here is a small example using a dictionary::"
@@ -424,19 +424,19 @@ msgstr "這是個使用一個字典的簡單範例:\n\n::"
424
424
msgid ""
425
425
"The :func:`dict` constructor builds dictionaries directly from sequences of "
426
426
"key-value pairs::"
427
- msgstr ""
427
+ msgstr "函式 :func:`dict` 可直接透過一串鍵值對序列來創建 dict:\n\n:: "
428
428
429
429
#: ../../tutorial/datastructures.rst:541
430
430
msgid ""
431
431
"In addition, dict comprehensions can be used to create dictionaries from "
432
432
"arbitrary key and value expressions::"
433
- msgstr ""
433
+ msgstr "此外, dict comprehensions 也可以透過鍵與值的陳述式來創建 dict :\n\n:: "
434
434
435
435
#: ../../tutorial/datastructures.rst:547
436
436
msgid ""
437
437
"When the keys are simple strings, it is sometimes easier to specify pairs "
438
438
"using keyword arguments::"
439
- msgstr ""
439
+ msgstr "當鍵是簡單的字串時,使用關鍵字引數 (keyword arguments) 有時會較為簡潔。 "
440
440
441
441
#: ../../tutorial/datastructures.rst:557
442
442
msgid "Looping Techniques"
0 commit comments