Skip to content

Instantly share code, notes, and snippets.

@galarant
Created October 5, 2016 15:58
Show Gist options
  • Save galarant/528b889977101e62fd4ef519bf08d581 to your computer and use it in GitHub Desktop.
Save galarant/528b889977101e62fd4ef519bf08d581 to your computer and use it in GitHub Desktop.
@coroutine
def increment_a_key(my_dict, key):
my_dict[key] += 1
def main():
example_dict = {'a': 1, 'b': 2, 'c': 3}
yield [increment_a_key(example_dict, k) for (k, v) in example_dict.items()]
print example_dict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment