質問するログイン新規登録

回答編集履歴

2

修正

2017/07/07 04:36

投稿

Lhankor_Mhy
Lhankor_Mhy

スコア37570

answer CHANGED
@@ -3,7 +3,7 @@
3
3
  import itertools
4
4
 
5
5
  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']
6
- for x in list( itertools.zip_longest( *[iter(arr)]*16, fillvalue=' ' ) ):
6
+ for x in itertools.zip_longest( *[iter(arr)]*16, fillvalue=' ' ):
7
7
  print ( *[ y[0]+' '+y[1] for y in zip( x[ ::4], x[1::4] ) ] )
8
8
  print ( *[ y[0]+' '+y[1] for y in zip( x[2::4], x[3::4] ) ] )
9
9
  ```

1

整形

2017/07/07 04:36

投稿

Lhankor_Mhy
Lhankor_Mhy

スコア37570

answer CHANGED
@@ -3,7 +3,7 @@
3
3
  import itertools
4
4
 
5
5
  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']
6
- for x in list(itertools.zip_longest(*[iter(arr)]*16, fillvalue=' ')):
6
+ for x in list( itertools.zip_longest( *[iter(arr)]*16, fillvalue=' ' ) ):
7
7
  print ( *[ y[0]+' '+y[1] for y in zip( x[ ::4], x[1::4] ) ] )
8
8
  print ( *[ y[0]+' '+y[1] for y in zip( x[2::4], x[3::4] ) ] )
9
9
  ```