arr[๋์ด][ํ][์ด]
# 3์ฐจ์๋ฆฌ์คํธ ์
๋ ฅ๋ฐ์์ ๋ง๋ค๊ธฐ
# ๋ฐฉ๋ฒ1 : ๋น ๋ฐฐ์ด์ 2์ฐจ์๋ฆฌ์คํธ ๋ฃ๊ธฐ
h, row, col = map(int, input().split())
arr = []
for i in range(h):
temp = []
for j in range(row):
temp.append(list(map(int, input().split())))
arr.append(temp) # ์ด์ฐจ์๋ฆฌ์คํธ append
print(arr)
# ๋ฐฉ๋ฒ2 : ๋ฆฌ์คํธ ์ปดํ๋ฆฌํจ์
์ผ๋ก ์ด์ฐจ์๋ฆฌ์คํธ ๋ง๋ค๊ณ ์ธ๋ฑ์ค๋ก ์ด์ฐจ์๋ฆฌ์คํธ ๋ฃ์ด์ฃผ๊ธฐ
h, row, col = map(int, input().split())
arr = [[] for _ in range(h)]
for i in range(h):
arr[i] = [list(map(int, input().split())) for _ in range(row)]
print(arr)
# ๋ฐฉ๋ฒ3 : ๋ฆฌ์คํธ ์ปดํ๋ฆฌํจ์
๋ง์ผ๋ก 3์ฐจ์๋ฆฌ์คํธ ๋ง๋ค๊ธฐ
h, row, col = map(int, input().split())
arr = [[list(map(int, input().split())) for _ in range(row)] for _ in range(h)]
print(arr)
"""
๋์ด2,ํ3,์ด4
[input]
2 3 4
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
17 18 19 20
21 22 23 24
[output]
[
[ [1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12] ],
[ [13, 14, 15, 16], [17, 18, 19, 20], [21, 22, 23, 24] ]
]
"""
Python
๋ณต์ฌ