# 1
mylist = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
new_list = [[], [], []]
for i in range(len(mylist)):
for j in range(len(mylist[i])):
new_list[i].append(mylist[j][i])
# 2
scores = [[i[j] for i in scores] for j in range(len(scores)]]
# 3
scores = list(map(list, zip(*scores)))
rotated = list(map(list, zip(*original[::-1])))
my_list = [[1, 2], [3, 4], [5, 6]]
# 방법 1 - sum 함수
answer = sum(my_list, [])
# 방법 2 - itertools.chain
import itertools
list(itertools.chain.from_iterable(my_list))
# 방법 4 - list comprehension 이용
[element for array in my_list for element in array]
# 방법 5 - reduce 함수 이용 1
from functools import reduce
list(reduce(lambda x, y: x+y, my_list))
행렬 transpose & rotate
transpose = list(map(list, zip(*original))) rotated = list(map(list, zip(*original[::-1])))