Skip to content

Instantly share code, notes, and snippets.

@adxrgh
Created May 3, 2017 14:57
Show Gist options
  • Save adxrgh/3f01059fb14d11a8456f7b332a527618 to your computer and use it in GitHub Desktop.
Save adxrgh/3f01059fb14d11a8456f7b332a527618 to your computer and use it in GitHub Desktop.
[构造字典] 使用两个列表 #dict:list
>>> keys = ['a', 'b', 'c']
>>> values = [1, 2, 3]
>>> dictionary = dict(zip(keys, values))
>>> print(dictionary)
{'a': 1, 'b': 2, 'c': 3}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment