Created
December 11, 2018 04:53
-
-
Save weiaicunzai/0173c770d1404e1dc46d60c98520aa4b to your computer and use it in GitHub Desktop.
iterate list every two elements
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
for x, y in zip(*[iter(line1)] * 2): | |
#line1(x0,y0,x1,y1) | |
#line1 -> (x0, y0), (x1, y1) | |
#. zip(*[iter(line1)] * 2) | |
#->zip(<tuple_iterator object at 0x10dafdb00>, <tuple_iterator object at 0x10dafdb00>) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment