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

回答編集履歴

1

リストに変換

2018/03/09 03:59

投稿

退会済みユーザー
answer CHANGED
@@ -4,11 +4,10 @@
4
4
  x =[[1,2,3], [4,5,6], [7,8,9]]
5
5
  print(x)
6
6
 
7
- # y = [items for items in zip(*x)] # 下の三行と同じ結果
7
+ # y = [list(items) for items in zip(*x)] # 下の三行と同じ結果
8
8
  y = []
9
9
  for items in zip(*x):
10
- y.append(items)
10
+ y.append(list(items))
11
11
 
12
-
13
12
  print(y)
14
13
  ```