标签:val origin pre lse key === else list app
dicVisit={}
if not dicVisit.has_key(visitKey):#不存在 diaSet = set() diaSet.add(diagnoseContent) dicVisit[visitKey]=diaSet #print ("new==="+visitKey + "-----"+diagnoseContent) else: #取出字典中对应元素值,是个 set,并将诊断加进去 originalDiaSet=dicVisit[visitKey] # for item in originalDiaSet: # print item originalDiaSet.add(diagnoseContent)
遍历:
for key in dicVisitList.keys(): valueDic = dicVisitList[key] jsonData.append(valueDic) print(valueDic)
标签:val origin pre lse key === else list app
原文地址:https://www.cnblogs.com/quietwalk/p/9104461.html