Skip to content

Instantly share code, notes, and snippets.

@smakhtin
Created October 12, 2015 19:54
Show Gist options
  • Save smakhtin/0d4c1588405d4d79fdf7 to your computer and use it in GitHub Desktop.
Save smakhtin/0d4c1588405d4d79fdf7 to your computer and use it in GitHub Desktop.
Update multiple dict values in Python
my_dict = dict.fromkeys(['a', 'b', 'c'], 10)
my_dict.update(dict.fromkeys(['b', 'e'], 20))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment