Skip to content

Instantly share code, notes, and snippets.

@tkaemming
Created February 9, 2016 23:16
Show Gist options
  • Save tkaemming/23c74896b127dd9b9c30 to your computer and use it in GitHub Desktop.
Save tkaemming/23c74896b127dd9b9c30 to your computer and use it in GitHub Desktop.
>>> data = {}
>>> key = 'key'
>>> data[key] = [key for key in ('foo', 'bar', 'baz')]
>>> print(data)
{'baz': ['foo', 'bar', 'baz']}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment