Skip to content

Commit f6024a7

Browse files
committed
add ',', modify output result
1 parent 35a4fa6 commit f6024a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/c01/p16_filter_sequence_elements.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
'5412 N CLARK',
9595
'5148 N CLARK',
9696
'5800 E 58TH',
97-
'2122 N CLARK'
97+
'2122 N CLARK',
9898
'5645 N RAVENSWOOD',
9999
'1060 W ADDISON',
100100
'4801 N BROADWAY',
@@ -111,7 +111,7 @@
111111
>>> more5
112112
[False, False, True, False, False, True, True, False]
113113
>>> list(compress(addresses, more5))
114-
['5800 E 58TH', '4801 N BROADWAY', '1039 W GRANVILLE']
114+
['5800 E 58TH', '1060 W ADDISON', '4801 N BROADWAY']
115115
>>>
116116
这里的关键点在于先创建一个 ``Boolean`` 序列,指示哪些元素符合条件。
117117
然后 ``compress()`` 函数根据这个序列去选择输出对应位置为 ``True`` 的元素。

0 commit comments

Comments
 (0)