Skip to content

Commit f1c54ee

Browse files
[po] auto sync
1 parent b5b26cb commit f1c54ee

File tree

2 files changed

+77
-1
lines changed

2 files changed

+77
-1
lines changed

.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "92.77%", "updated_at": "2024-09-23T08:57:35Z"}
1+
{"translation": "92.78%", "updated_at": "2024-09-23T09:57:35Z"}

tutorial/datastructures.po

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,28 @@ msgid ""
831831
">>> a ^ b # letters in a or b but not both\n"
832832
"{'r', 'd', 'b', 'm', 'z', 'l'}"
833833
msgstr ""
834+
">>> basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}\n"
835+
">>> print(basket) # 显示重复项已被移除\n"
836+
"{'orange', 'banana', 'pear', 'apple'}\n"
837+
">>> 'orange' in basket # 快速成员检测\n"
838+
"True\n"
839+
">>> 'crabgrass' in basket\n"
840+
"False\n"
841+
"\n"
842+
">>> # 演示针对两个单词中独有的字母进行集合运算\n"
843+
">>>\n"
844+
">>> a = set('abracadabra')\n"
845+
">>> b = set('alacazam')\n"
846+
">>> a # a 中独有的字母\n"
847+
"{'a', 'r', 'b', 'c', 'd'}\n"
848+
">>> a - b # 存在于 a 中但不存在于 b 中的字母\n"
849+
"{'r', 'd', 'b'}\n"
850+
">>> a | b # 存在于 a 或 b 中或两者中皆有的字母\n"
851+
"{'a', 'c', 'r', 'd', 'b', 'm', 'z', 'l'}\n"
852+
">>> a & b # 同时存在于 a 和 b 中的字母\n"
853+
"{'a', 'c'}\n"
854+
">>> a ^ b # 存在于 a 或 b 中但非两者中皆有的字母\n"
855+
"{'r', 'd', 'b', 'm', 'z', 'l'}"
834856

835857
#: ../../tutorial/datastructures.rst:482
836858
msgid ""
@@ -1055,6 +1077,14 @@ msgid ""
10551077
"What is your quest? It is the holy grail.\n"
10561078
"What is your favorite color? It is blue."
10571079
msgstr ""
1080+
">>> questions = ['name', 'quest', 'favorite color']\n"
1081+
">>> answers = ['lancelot', 'the holy grail', 'blue']\n"
1082+
">>> for q, a in zip(questions, answers):\n"
1083+
"... print('What is your {0}? It is {1}.'.format(q, a))\n"
1084+
"...\n"
1085+
"What is your name? It is lancelot.\n"
1086+
"What is your quest? It is the holy grail.\n"
1087+
"What is your favorite color? It is blue."
10581088

10591089
#: ../../tutorial/datastructures.rst:600
10601090
msgid ""
@@ -1073,6 +1103,14 @@ msgid ""
10731103
"3\n"
10741104
"1"
10751105
msgstr ""
1106+
">>> for i in reversed(range(1, 10, 2)):\n"
1107+
"... print(i)\n"
1108+
"...\n"
1109+
"9\n"
1110+
"7\n"
1111+
"5\n"
1112+
"3\n"
1113+
"1"
10761114

10771115
#: ../../tutorial/datastructures.rst:612
10781116
msgid ""
@@ -1093,6 +1131,16 @@ msgid ""
10931131
"orange\n"
10941132
"pear"
10951133
msgstr ""
1134+
">>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana']\n"
1135+
">>> for i in sorted(basket):\n"
1136+
"... print(i)\n"
1137+
"...\n"
1138+
"apple\n"
1139+
"apple\n"
1140+
"banana\n"
1141+
"orange\n"
1142+
"orange\n"
1143+
"pear"
10961144

10971145
#: ../../tutorial/datastructures.rst:626
10981146
msgid ""
@@ -1115,6 +1163,14 @@ msgid ""
11151163
"orange\n"
11161164
"pear"
11171165
msgstr ""
1166+
">>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana']\n"
1167+
">>> for f in sorted(set(basket)):\n"
1168+
"... print(f)\n"
1169+
"...\n"
1170+
"apple\n"
1171+
"banana\n"
1172+
"orange\n"
1173+
"pear"
11181174

11191175
#: ../../tutorial/datastructures.rst:639
11201176
msgid ""
@@ -1134,6 +1190,15 @@ msgid ""
11341190
">>> filtered_data\n"
11351191
"[56.2, 51.7, 55.3, 52.5, 47.8]"
11361192
msgstr ""
1193+
">>> import math\n"
1194+
">>> raw_data = [56.2, float('NaN'), 51.7, 55.3, 52.5, float('NaN'), 47.8]\n"
1195+
">>> filtered_data = []\n"
1196+
">>> for value in raw_data:\n"
1197+
"... if not math.isnan(value):\n"
1198+
"... filtered_data.append(value)\n"
1199+
"...\n"
1200+
">>> filtered_data\n"
1201+
"[56.2, 51.7, 55.3, 52.5, 47.8]"
11371202

11381203
#: ../../tutorial/datastructures.rst:656
11391204
msgid "More on Conditions"
@@ -1201,6 +1266,10 @@ msgid ""
12011266
">>> non_null\n"
12021267
"'Trondheim'"
12031268
msgstr ""
1269+
">>> string1, string2, string3 = '', 'Trondheim', 'Hammer Dance'\n"
1270+
">>> non_null = string1 or string2 or string3\n"
1271+
">>> non_null\n"
1272+
"'Trondheim'"
12041273

12051274
#: ../../tutorial/datastructures.rst:693
12061275
msgid ""
@@ -1245,6 +1314,13 @@ msgid ""
12451314
"(1, 2, 3) == (1.0, 2.0, 3.0)\n"
12461315
"(1, 2, ('aa', 'ab')) < (1, 2, ('abc', 'a'), 4)"
12471316
msgstr ""
1317+
"(1, 2, 3) < (1, 2, 4)\n"
1318+
"[1, 2, 3] < [1, 2, 4]\n"
1319+
"'ABC' < 'C' < 'Pascal' < 'Python'\n"
1320+
"(1, 2, 3, 4) < (1, 2, 4)\n"
1321+
"(1, 2) < (1, 2, -1)\n"
1322+
"(1, 2, 3) == (1.0, 2.0, 3.0)\n"
1323+
"(1, 2, ('aa', 'ab')) < (1, 2, ('abc', 'a'), 4)"
12481324

12491325
#: ../../tutorial/datastructures.rst:724
12501326
msgid ""

0 commit comments

Comments
 (0)