c_dict = {'0':{'id':'222'},'1':{'id':'222'},'2':{'id':'333'}}
請問若要將原本dict中id值為重複的刪除,只留下方結果,有什麼好方法嗎?
謝謝。
c_dict = {'0':{'id':'222'},'1':{'id':'333'}}
result = {}
for key, value in c_dict.items():
if value not in result.values():
result[key] = value