a = [{'name':'lilei','age':'18'},{'name':'tom','age':'18'},{'name':'lilei','age':'20'}]
b={}
for item in a:
b.setdefault(item['name'],{**item,})
b = list(b.values())
print(b)
a = [{'name':'lilei','age':'18'},{'name':'tom','age':'18'},{'name':'lilei','age':'20'}]
b={}
for item in a:
b.setdefault(item['name'],{**item,})
b = list(b.values())
print(b)