Created
October 25, 2019 10:25
-
-
Save vlad-bezden/e5dcb9f8743b67dd7892a7aec946ac53 to your computer and use it in GitHub Desktop.
Splits iterable by pairs.
This file contains hidden or 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
print(*zip(*[iter(range(20)] * 2)) | |
# output | |
# (0, 1) (2, 3) (4, 5) (6, 7) (8, 9) (10, 11) (12, 13) (14, 15) (16, 17) (18, 19) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment