其實我有這種類型的如何跳過追加到類型列表的字典值重複
d={'a':{'s':'100100.sss','s1':'100200.ss2','s2':'100200.333'},
'b':{'t':'100100.yyy','u':'100100.rrr','i':'1001500ttt'},'c':{'f':'g','y':'o'}}
的字典從此我創建這種類型
temp={'a':['100100','100200','100200'],'b':['100100',100100'],'c'=[]}
的字典爲此,我我用這樣的代碼
temp={}
for k,v in d.items():
temp[k]=[]
for key,val in v.items():
templist=val.split(".")
if templist[0].isdigit():
if templist[0] not in a.values():
temp[k].append(templist[0])
else:
continue
其實我想快譯通這種類型
temp={'a':['100100','100200'],'b':['100100'],'c'=[]}
我已更新我的問題 – user1182090 2012-04-17 09:55:11
@ -eumiro感謝它的工作 – user1182090 2012-04-17 10:12:21