回答編集履歴
2
修正
test
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
arr = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
|
10
10
|
|
11
|
-
for x in
|
11
|
+
for x in itertools.zip_longest( *[iter(arr)]*16, fillvalue=' ' ):
|
12
12
|
|
13
13
|
print ( *[ y[0]+' '+y[1] for y in zip( x[ ::4], x[1::4] ) ] )
|
14
14
|
|
1
整形
test
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
arr = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
|
10
10
|
|
11
|
-
for x in list(itertools.zip_longest(*[iter(arr)]*16, fillvalue=' ')):
|
11
|
+
for x in list( itertools.zip_longest( *[iter(arr)]*16, fillvalue=' ' ) ):
|
12
12
|
|
13
13
|
print ( *[ y[0]+' '+y[1] for y in zip( x[ ::4], x[1::4] ) ] )
|
14
14
|
|