列表与字典应用:
l = [10,25,38,44,56,66,79,87,90,93]
result ={'k1': [77, 88, 99, 90], 'k2': [11, 22, 33, 44, 55]}
for item in l:
if item < 66:
# result.update({"k1": item})
if "k1" in result:
result['k1'] = [item]
else:
result['k1'].append(item)
elif item > 66:
if "k2" not in result:
result['k2'] = [item, ]
else:
result['k2'].append(item)
print(result)