Created
December 11, 2016 15:57
-
-
Save belsander/6b901b7ef60fad1a93a02d20db45d70d to your computer and use it in GitHub Desktop.
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
zip([iterable, ...]) | |
# Example | |
>>> test_list1 = ["a", "b", "c"] | |
>>> test_list2 = [1, 2, 3] | |
>>> zip(test_list1, test_list2) | |
[('a', 1), ('b', 2), ('c', 3)] | |
>>> dict(zip(test_list1, test_list2)) | |
{'a': 1, 'c': 3, 'b': 2} | |
>>> test_list2 = [1, 2, 3, 4] | |
>>> dict(zip(test_list1, test_list2)) | |
{'a': 1, 'c': 3, 'b': 2} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment