data=[['G05', 'Hopscotch', 'N', '2'],['G07', 'Dominoes', 'S', '5'],['G08', 'Chess', 'N', '3'],['G10','Monopoly', 'N', '3'],['G02', 'MineCraft', 'S', '5']]
data1={'G07': [3, 2], 'G08': [2, 2], 'G10': [1, 1],'G02': [5, 3],'G05': [5, 3]}
请问该怎么在不使用库的情况下,判断二维列表里面每个表的第一个值和字典的键是否相等?如果相等则将键的值追加到列表后面?
变成这样
[['G05', 'Hopscotch', 'N', '2','5','3'],['G07', 'Dominoes', 'S', '5','3','2'],['G08', 'Chess', 'N', '3','2','2'],['G10','Monopoly', 'N', '3','1','1'],[G02', 'MineCraft', 'S', '5','5','3']]
二维列表和字典的顺序不确定