Skip to content

Instantly share code, notes, and snippets.

@tkmru
Created December 15, 2013 20:27
Show Gist options
  • Save tkmru/7977703 to your computer and use it in GitHub Desktop.
Save tkmru/7977703 to your computer and use it in GitHub Desktop.
Using fromkeys, keys's list become dict object.
>>> dict.fromkeys(['A', 'B', 'C'], True)
{'A': True, 'C': True, 'B': True}
>>> dict.fromkeys(['A', 'B', 'C'])
{'A': None, 'C': None, 'B': None}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment