Created
November 8, 2016 00:00
-
-
Save recuraki/f5da2e9ffd38526109cc9f94fdee4298 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
#!/usr/bin/python | |
l = [100,200,201,202,203,301,303,305,306,401,402,403,405,501,502,601,602,603,701] | |
# [[100, 200, 201, 202, 203, 301, 303, 305], [401, 402, 403, 405, 501, 502, 601, 602], [701]] | |
def f(s, l = 9): | |
i = 0 | |
for i in range(len(s) / l): | |
yield s[l * i:l * i + 8] | |
yield s[l * (i + 1): len(s)] | |
print([x for x in f(l)]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
s=[]のとき[[]]になっちゃうのは微妙か。