I have a problem with combining or calculating common/equal part of these two dictionaries. In my dictionaries, values are lists:
d1 = {0:['11','18','25','38'],
1:['11','18','25','38'],
2:['11','18','25','38'],
3:['11','18','25','38']}
d2 = {0:['05','08','11','13','16','25','34','38','40', '43'],
1:['05', '08', '09','13','15','20','32','36','38', '40','41'],
2:['02', '08', '11', '13', '18', '20', '22','33','36','39'],
3:['06', '11', '12', '25', '26', '27', '28', '30', '31', '37']}
I'd like to check "d2" and know if there are numbers from "d1". If there are some, I'd like to update one of them with new data or receive 3rd dictionary "d3" with only the values that are identical/equal in both "d1" and "d2" like:
d3 = {0:['11','25','38'], 1:['38'], 2:['11','18'], 3:['11','25']}
Can anyone help me with this?
My fault I forgot to be more specific. I'm looking for a solution in Python.