I'm currently starting a project to apply something I just learned, but I will probably get bored in a couple days once I finish applying my learnings. It doesn't matter when you read this.
For python 3.4 and below a simpler solution would look like this:
>>> c = a.copy()
>>> c.update(b)
>>> c
{1: 1, 2: 2, 3: 3}
>>>
(The copy is only there to prevent mutation of the original dictionaries, but if you are fine with the mutation, you can skip that step and just update a with b)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great post! Just a side note regarding dictionary merging.
In python 3.5 or greater you can merge dictionaries by doing this:
Kind of like a spread operator.
For python 3.4 and below a simpler solution would look like this:
(The copy is only there to prevent mutation of the original dictionaries, but if you are fine with the mutation, you can skip that step and just update a with b)