赞
踩
list_custom = [{"name":"nidaye"},
{"name":"lujianfei"},
{"name":"lijieying"}]
flist = list(filter(lambda x: x["name"] == "lujianfei", list_custom))
print(list_custom)
print(flist)
打印结果
[{'name': 'nidaye'}, {'name': 'lujianfei'}, {'name': 'lijieying'}]
[{'name': 'lujianfei'}]
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。