Skip to content

Instantly share code, notes, and snippets.

@computer-tutor
Last active May 8, 2021 09:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save computer-tutor/23f881727829023ca86ed75a3895d0e4 to your computer and use it in GitHub Desktop.
Save computer-tutor/23f881727829023ca86ed75a3895d0e4 to your computer and use it in GitHub Desktop.
def add_dict(dict1, dict2):
return dict(list(dict1.items()) + list(dict2.items()))
dic1 = {'a':1, 'b':2, 'c':3}
dic2 = {'c':4, 'd':5, 'e':6}
print(add_dict(dic1, dic2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment