8000 Translate faq/design.html#why-are-there-separate-tuple-and-list-data-… · python/python-docs-zh-tw@a699463 · GitHub
[go: up one dir, main page]

Skip to content

Commit a699463

Browse files
committed
Translate faq/design.html#why-are-there-separate-tuple-and-list-data-types
1 parent e67d201 commit a699463

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

faq/design.po

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ msgstr ""
693693

694694
#: ../../faq/design.rst:400
695695
msgid "Why are there separate tuple and list data types?"
696-
msgstr ""
696+
msgstr "為何要把值組 (tuple) 和串列 (list) 分成兩個資料型態?"
697697

698698
#: ../../faq/design.rst:402
699699
msgid ""
@@ -704,6 +704,10 @@ msgid ""
704704
"Cartesian coordinate is appropriately represented as a tuple of two or three "
705705
"numbers."
706706
msgstr ""
707+
"串列和值組在很多方面相當相似,但通常用在完全不同的地方。值組可以想成 Pascal "
708+
"的紀錄 (records) 或是 C 的結構 (structs),是一小群相關聯但可能是不同型別的資"
709+
"料集合,以一組為單位進行操作。舉例來說,一個笛卡兒坐標系可以適當地表示成一個"
710+
"有二或三個值的值組。"
707711

708712
#: ../../faq/design.rst:409
709713
msgid ""
@@ -714,6 +718,9 @@ msgid ""
714718
"Functions which operate on this output would generally not break if you "
715719
"added another file or two to the directory."
716720
msgstr ""
721+
"另一方面,串列更像是其他語言的陣列 (array)。他可以有不固定個同類別物件,且為"
722+
"逐項操作。舉例來說,``os.listdir('.')`` 回傳當下目錄裡的檔案,以包含字串的列"
723+
"表表示。如果你新增了幾個檔案到這個目錄,一般來說操作結果的函式也會正常運作。"
717724

718725
#: ../../faq/design.rst:416
719726
msgid ""
@@ -723,6 +730,9 @@ msgid ""
723730
"be used as dictionary keys, and hence only tuples and not lists can be used "
724731
"as keys."
725732
msgstr ""
733+
"值組則是不可變的,代表一旦值組被建立,你就不能夠改變裡面的任何一個值。而串列"
734+
"可變,所以你可以改變裡面的元素。只有不可變的元素可以成為字典的鍵,所以只能把"
735+
"值組當成鍵,而串列則不行。"
726736

727737
#: ../../faq/design.rst:423
728738
msgid "How are lists implemented in CPython?"

0 commit comments

Comments
 (0)
0