Skip to content

Instantly share code, notes, and snippets.

@jaychoo
Created September 27, 2011 17:35
Show Gist options
  • Save jaychoo/1245697 to your computer and use it in GitHub Desktop.
Save jaychoo/1245697 to your computer and use it in GitHub Desktop.
Create dictionary with list of keys (and empty value)
def get_dict(keys):
if keys:
return dict([k, ''] for k in keys)
return {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment