📌  相关文章
📜  如何在列表python代码示例中查找单词

📅  最后修改于: 2022-03-11 14:46:23.425000             🧑  作者: Mango

代码示例3
ls = ['Hello from AskPython', 'Hello', 'Hello boy!', 'Hi']
 
# The second parameter is the input iterable
# The filter() applies the lambda to the iterable
# and only returns all matches where the lambda evaluates
# to true
filter_object = filter(lambda a: 'AskPython' in a, ls)
 
# Convert the filter object to list
print(list(filter_object))