Created
July 7, 2017 04:38
-
-
Save bgnori/141b5fd0c2b7ee5374c76ab2c378f437 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
# coding: utf-8 | |
import itertools | |
def baz(xs, n): | |
ys = list(itertools.zip_longest(xs[n::4], xs[n+1::4], fillvalue=' ')) | |
zs = itertools.zip_longest(ys[0::4], ys[1::4], ys[2::4], ys[3::4], fillvalue=(' ', ' ')) | |
return [[p for ps in z for p in ps] for z in zs] | |
xs = [chr(i) for i in range(ord('a'), ord('z')+1)] | |
for s in [" ".join(line) for lines in zip(baz(xs, 0), baz(xs, 2)) for line in lines]: | |
print(s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment