@@ -693,7 +693,7 @@ msgstr ""
693
693
694
694
#: ../../faq/design.rst:400
695
695
msgid "Why are there separate tuple and list data types?"
696
- msgstr ""
696
+ msgstr "為何要把值組 (tuple) 和串列 (list) 分成兩個資料型態? "
697
697
698
698
#: ../../faq/design.rst:402
699
699
msgid ""
@@ -704,6 +704,10 @@ msgid ""
704
704
"Cartesian coordinate is appropriately represented as a tuple of two or three "
705
705
"numbers."
706
706
msgstr ""
707
+ "串列和值組在很多方面相當相似,但通常用在完全不同的地方。值組可以想成 Pascal "
708
+ "的紀錄 (records) 或是 C 的結構 (structs),是一小群相關聯但可能是不同型別的資"
709
+ "料集合,以一組為單位進行操作。舉例來說,一個笛卡兒坐標系可以適當地表示成一個"
710
+ "有二或三個值的值組。"
707
711
708
712
#: ../../faq/design.rst:409
709
713
msgid ""
@@ -714,6 +718,9 @@ msgid ""
714
718
"Functions which operate on this output would generally not break if you "
715
719
"added another file or two to the directory."
716
720
msgstr ""
721
+ "另一方面,串列更像是其他語言的陣列 (array)。他可以有不固定個同類別物件,且為"
722
+ "逐項操作。舉例來說,``os.listdir('.')`` 回傳當下目錄裡的檔案,以包含字串的列"
723
+ "表表示。如果你新增了幾個檔案到這個目錄,一般來說操作結果的函式也會正常運作。"
717
724
718
725
#: ../../faq/design.rst:416
719
726
msgid ""
@@ -723,6 +730,9 @@ msgid ""
723
730
"be used as dictionary keys, and hence only tuples and not lists can be used "
724
731
"as keys."
725
732
msgstr ""
733
+ "值組則是不可變的,代表一旦值組被建立,你就不能夠改變裡面的任何一個值。而串列"
734
+ "可變,所以你可以改變裡面的元素。只有不可變的元素可以成為字典的鍵,所以只能把"
735
+ "值組當成鍵,而串列則不行。"
726
736
727
737
#: ../../faq/design.rst:423
728
738
msgid "How are lists implemented in CPython?"
0 commit comments