I have two dictionaries with contents:
dct1 = {'NL': 7,'MC': 9, 'PG': 8}
dct2 = {'NL': 2,'MC': 10,'PG': 6}
You could say these represents scores from a game where the letters are names and the numbers are scores. The difference between the two dictionaries are the numbers in which they are calculated based on criteria.
Now i want to combine the contents from the dictionary into a list of list. I'm going to provide just a rough idea of my code. Basically what i did then was turning the contents in the two dictionaries into a list of list where:
L1 = [['NL',7],['MC',9],['PG',8]]
L2 = [['NL',2],['MC',10],['PG',6]]
The code for turning them into a list of list:
L1 = []
for i, occurrences in dct1.items():
L1.append([i,occurrences])
L2 = []
for j, occurrences in dct2.items():
L2.append([j,occurrences])
and once i print both list, i get as what I've written above.
But now, instead of having two different list, i want to combine both of them into a single list where my output is:
L3 = [['NL',7,2],['MC',9,10],['PG',8,6]]
Basically the single list does not have to repeat the letters twice and just adding the second digit. Any help is much appreciated.