📜  使用 lambda 函数作为参数之一的 python 过滤函数 - Python 代码示例

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

代码示例1
names = ["margarita", "Linda", "Masako", "Maki", "Angela"]
 
M_names = filter(lambda name: name[0] == "M" or name[0] == "m", names) 
 
print(list(M_names))