1. 代码 v_dict = [{ 'a' : 'a' }, { 'a' : 'a' }] a = [ str ( l ) for l in v_dict ] # 去重 a_set = set ( a ) v_list = [ eval ( i ) for i in a_set ] print ( v_list )
1. 代码
v_dict = [{'a': 'a'}, {'a': 'a'}]a = [str(l) for l in v_dict]
# 去重
a_set = set(a)
v_list = [eval(i) for i in a_set]
print(v_list)