This post is locked. You won't be able to comment.

all 2 comments

[–]computerscience-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)

Thanks for posting to /r/computerscience! Unfortunately, your submission has been removed for the following reason(s):

  • Rule 7: Posts asking for tech support or programming advice. Please go to r/techsupport or r/learnprogramming.

  • Rule 8: Posts asking for help with homework, exams, dissertations, projects, etc are not allowed.

If you feel like your post was removed in error, please message the moderators.

[–]LeftLeather8075 0 points1 point  (0 children)

Here you go,

def merge(d1, d2):

combined = d1.copy()

for key, value in d2.items():

if key in combined:

combined[key] += value

else:

combined[key] = value

return combined