ประโยคภาษาจีน : 中文句子 |
---|
qīng dān 清单 zhòng dì 中的 fāng fǎ 方法 jiē shòu 接受 le 了 yí gè 一个 hé 和 yí gè 一个 zhǐ dìng 指定 rú hé 如何 guò lǜ 过滤 liè biǎo 列表 de 的 dài mǎ 代码 kuài 块 bìng 并 duì 对 liè biǎo 列表 jìn xíng 进行 biàn lì 遍历 jiāng 将 mǎn zú 满足 wèi yǔ 谓语 de 的 xiàng 项 tiān jiā 添加 dào 到 yí gè 一个 xīn 新 liè biǎo 列表 zhōng 中 |
The filter() method in Listing 9 accepts a list and a criteria (a code block specifying how to filter the list) and iterates over the list, adding each item to a new list if it matches the predicate. |