example = {'good':[1,2],'bad':[5,10],'great':[9,4]}
example2 = {'good':2,'bad':3}
I want to multiply the list values by the integers for the matching keys and create a new dictionary, so I should get:
example3 = {'good':[2,4],'bad':[15,30]}
How can I do this? I have tried:
example3 = {k:example.get(k) * example2.get(k) for k in set(example) & set(example2)}
but the output is:{'bad': [5, 10, 5, 10, 5, 10], 'good': [1, 2, 1, 2]}
The problem I have is how to multiply the list values by integers.