标签:tde 列表 def pen 操作 end app col set
li = [11,22,33,44,55,77,88,99,90] dic = {} for i in li: if i > 66 : if ‘k1‘ in dic: dic[‘k1‘].append(i) else: dic.setdefault(‘k1‘,[i]) else: if ‘k2‘ in dic: dic[‘k2‘].append(i) else: dic.setdefault(‘k2‘,[i]) print(dic)
标签:tde 列表 def pen 操作 end app col set
原文地址:https://www.cnblogs.com/limw/p/9689653.html