python-检查列表中 字典values是否存在
app_list = []
system_dict = {
"name": "11",
"x": 2
}
for i in range(2):
if not any(d['name'] == '11' for d in app_list):
app_list.append(system_dict)
print(system_dict)
app_list = []
system_dict = {
"name": "11",
"x": 2
}
for i in range(2):
if not any(d['name'] == '11' for d in app_list):
app_list.append(system_dict)
print(system_dict)