Created
May 3, 2017 14:57
-
-
Save adxrgh/3f01059fb14d11a8456f7b332a527618 to your computer and use it in GitHub Desktop.
[构造字典] 使用两个列表 #dict:list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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