标签:
t1 = [[‘aa‘],[‘ff‘],[‘er‘]]t2 = [[‘aa‘, 11,],[‘er‘, 99,]]d2 = dict(t2)res = [[k[0], d2.get(k[0], 0)] for k in t1]
t1 = [
[‘aa‘],
[‘ff‘],
[‘er‘]
]
t2 = [
[‘aa‘, 11,],
[‘er‘, 99,]
d2 = dict(t2)
res = [[k[0], d2.get(k[0], 0)] for k in t1]
python 字典get方法
原文地址:http://www.cnblogs.com/iathena/p/bbbf5254f83c95d1dcfde76fd30c9aa9.html