๋ฐ์ํ
์ด ๋ค์ฏ์ค์ ์ ๋ ฅ์ด ์ฃผ์ด์ง๋ค. ๊ฐ ์ค์๋ ์ต์ 1๊ฐ, ์ต๋ 15๊ฐ์ ๊ธ์๋ค์ด ๋น์นธ ์์ด ์ฐ์์ผ๋ก ์ฃผ์ด์ง๋ค. ์ฃผ์ด์ง๋ ๊ธ์๋ ์์ด ๋๋ฌธ์ ‘A’๋ถํฐ ‘Z’, ์์ด ์๋ฌธ์ ‘a’๋ถํฐ ‘z’, ์ซ์ ‘0’๋ถํฐ ‘9’ ์ค ํ๋์ด๋ค. ๊ฐ ์ค์ ์์๊ณผ ๋ง์ง๋ง์ ๋น์นธ์ ์๋ค.
In [1]:
# ์ธ๋ก ์ฝ๊ธฐ
space = []
for row in range(5):
row = [0] * 15
space.append(row)
space
Out[1]:
[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
In [3]:
for x in range(5):
height = list(input())
for y in range(len(height)):
space[x][y] = height[y]
dlksjakldv131
lkfjdsf,`12
csdjac.,jads
; o2p4i5;
0-c843m,sda
In [4]:
space
Out[4]:
[['d', 'l', 'k', 's', 'j', 'a', 'k', 'l', 'd', 'v', '1', '3', '1', 0, 0],
['l', 'k', 'f', 'j', 'd', 's', 'f', ',', '`', '1', '2', '4', 0, 0, 0],
['c', 's', 'd', 'j', 'a', 'c', '.', ',', 'j', 'a', 'd', 's', 0, 0, 0],
[';', ' ', 'o', '2', 'p', '4', 'i', '5', ';', 'f', 'a', ',', '3', '1', '2'],
['0', '-', 'c', '8', '4', '3', 'm', ',', 's', 'd', 'a', 0, 0, 0, 0]]
In [5]:
# x,y ์ถ ๋ณ๊ฒฝ
for x in range(15):
for y in range(5):
if space[y][x]==0:
continue;
else:
print(space[y][x], end='')
dlc;0lks -kfdocsjj28jdap4asc43kf.iml,,5,d`j;sv1afd12daa34s,1312
๋ฐ์ํ
'๐๏ธ์ํํธ์จ์ด > ๐ปpython' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
vscode์์ rtx 2060super ์จ๋จน์ด๋ณด๊ธฐ (feat.gpu cuda๋ฅผ ์ข์จ๋ณด์) (0) | 2021.12.03 |
---|---|
crawling parrel processing (0) | 2021.11.30 |
[python] Yotube crawling , ์๋ ํฌ๋กค๋ฌ ๊ฐ๋ฐ (0) | 2021.11.28 |
[python] ์๋์ฐจ ํฌ๋กค๋ง (1) | 2021.11.28 |
[python ๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ]ํ์ด์ ํน์ ๋ฌธ์์ด ํ ์ญ์ (0) | 2021.11.28 |