{"id":1318,"date":"2023-01-23T17:32:10","date_gmt":"2023-01-23T08:32:10","guid":{"rendered":"https:\/\/blog.dozzing.kr\/?p=1318"},"modified":"2025-10-24T18:10:51","modified_gmt":"2025-10-24T09:10:51","slug":"python-2%ec%b0%a8%ec%9b%90-%eb%a6%ac%ec%8a%a4%ed%8a%b8-%ec%83%9d%ec%84%b1-%ec%9e%85%eb%a0%a5-%ec%b0%be%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/blog.dozzing.kr\/?p=1318","title":{"rendered":"[Python] 2\ucc28\uc6d0 \ub9ac\uc2a4\ud2b8 \uc0dd\uc131, \uc785\ub825, \ucc3e\uae30"},"content":{"rendered":"<h2>\ud83d\udcab 2\ucc28\uc6d0 \ub9ac\uc2a4\ud2b8\ub780?<\/h2>\n<pre><code class=\"language-python line-numbers\">matrix = [\n    [1, 2, 3],\n    [4, 5, 6],\n    [7, 8, 9]\n]\n<\/code><\/pre>\n<ul>\n<li><strong>\ub9ac\uc2a4\ud2b8 \uc548\uc5d0 \ub610 \ub2e4\ub978 \ub9ac\uc2a4\ud2b8\uac00 \ub4e4\uc5b4\uc788\ub294 \uad6c\uc870<\/strong><\/li>\n<li>\ubcf4\ud1b5 <strong>\ud589(row)\uacfc \uc5f4(column)<\/strong> \ud615\ud0dc\uc758 \ub370\uc774\ud130\ub97c \ud45c\ud604\ud560 \ub54c \uc0ac\uc6a9<\/li>\n<\/ul>\n<h2>\ud83d\udcab 2\ucc28\uc6d0 \ub9ac\uc2a4\ud2b8 \uc0dd\uc131\ud558\uae30<\/h2>\n<pre><code class=\"language-python line-numbers\"># \uc9c1\uc811 \ucd08\uae30\ud654\nmatrix = [\n    [0, 0, 0],\n    [0, 0, 0],\n    [0, 0, 0]\n]\n\n# List Comprehension \ud65c\uc6a9\nrows, cols = 3, 4\nmatrix = [[0 for _ in range(cols)] for _ in range(rows)]\nprint(matrix)  # [[0,0,0,0],[0,0,0,0],[0,0,0,0]]\n<\/code><\/pre>\n<h2>\ud83d\udcab \uac12 \uc785\ub825\ud558\uae30<\/h2>\n<pre><code class=\"language-python line-numbers\"># \ud2b9\uc815 \uc704\uce58 \uac12 \ubcc0\uacbd\nmatrix[1][2] = 99\nprint(matrix)  # \ub450 \ubc88\uc9f8 \ud589, \uc138 \ubc88\uc9f8 \uc5f4\uc774 99\ub85c \ubc14\ub01c\n\n# \ubc18\ubcf5\ubb38\uc73c\ub85c \ucc44\uc6b0\uae30\nrows, cols = 3, 3\nmatrix = [[0 for _ in range(cols)] for _ in range(rows)]\n\nnum = 1\nfor i in range(rows):\n    for j in range(cols):\n        matrix[i][j] = num\n        num += 1\n\nprint(matrix)  # [[1,2,3],[4,5,6],[7,8,9]]\n<\/code><\/pre>\n<h2>\ud83d\udcab \uac12 \ucc3e\uae30<\/h2>\n<pre><code class=\"language-python line-numbers\"># \ubc18\ubcf5\ubb38\uc73c\ub85c \ucc3e\uae30\nmatch_list = []\ntarget = 1\n\nfor i in range(len(matrix)):\n    for j in range(len(matrix[i])):\n        if matrix[i][j] == target:\n            match_list.append([i,j])\n\n# List Comprehension\uc73c\ub85c \uc704\uce58 \ucc3e\uae30\nmatch_list = [(i, j) for i in range(len(matrix)) for j in range(len(matrix[i])) if matrix[i][j] == target]\nprint(match_list)  # [(1, 1)]\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\ud83d\udcab 2\ucc28\uc6d0 \ub9ac\uc2a4\ud2b8\ub780? matrix = [ [1, 2, 3], [4, 5, 6], [7, 8, 9] ] \ub9ac\uc2a4\ud2b8 \uc548\uc5d0 \ub610 \ub2e4\ub978 \ub9ac\uc2a4\ud2b8\uac00 \ub4e4\uc5b4\uc788\ub294 \uad6c\uc870 \ubcf4\ud1b5 \ud589(row)\uacfc \uc5f4(column) \ud615\ud0dc\uc758 \ub370\uc774\ud130\ub97c \ud45c\ud604\ud560 \ub54c \uc0ac\uc6a9 \ud83d\udcab 2\ucc28\uc6d0 \ub9ac\uc2a4\ud2b8 \uc0dd\uc131\ud558\uae30 # \uc9c1\uc811 \ucd08\uae30\ud654 matrix = [ [0, 0, 0], [0, 0, 0], [0, 0, 0] ] # List Comprehension \ud65c\uc6a9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41,49],"tags":[42],"class_list":["post-1318","post","type-post","status-publish","format-standard","hentry","category-python","category-system-development","tag-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Python] 2\ucc28\uc6d0 \ub9ac\uc2a4\ud2b8 \uc0dd\uc131, \uc785\ub825, \ucc3e\uae30 - Dozzing World<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.dozzing.kr\/?p=1318\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Python] 2\ucc28\uc6d0 \ub9ac\uc2a4\ud2b8 \uc0dd\uc131, \uc785\ub825, \ucc3e\uae30 - Dozzing World\" \/>\n<meta property=\"og:description\" content=\"\ud83d\udcab 2\ucc28\uc6d0 \ub9ac\uc2a4\ud2b8\ub780? matrix = [ [1, 2, 3], [4, 5, 6], [7, 8, 9] ] \ub9ac\uc2a4\ud2b8 \uc548\uc5d0 \ub610 \ub2e4\ub978 \ub9ac\uc2a4\ud2b8\uac00 \ub4e4\uc5b4\uc788\ub294 \uad6c\uc870 \ubcf4\ud1b5 \ud589(row)\uacfc \uc5f4(column) \ud615\ud0dc\uc758 \ub370\uc774\ud130\ub97c \ud45c\ud604\ud560 \ub54c \uc0ac\uc6a9 \ud83d\udcab 2\ucc28\uc6d0 \ub9ac\uc2a4\ud2b8 \uc0dd\uc131\ud558\uae30 # \uc9c1\uc811 \ucd08\uae30\ud654 matrix = [ [0, 0, 0], [0, 0, 0], [0, 0, 0] ] # List Comprehension \ud65c\uc6a9 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.dozzing.kr\/?p=1318\" \/>\n<meta property=\"og:site_name\" content=\"Dozzing World\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-23T08:32:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-24T09:10:51+00:00\" \/>\n<meta name=\"author\" content=\"Dozzing\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dozzing\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"2\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.dozzing.kr\/?p=1318\",\"url\":\"https:\/\/blog.dozzing.kr\/?p=1318\",\"name\":\"[Python] 2\ucc28\uc6d0 \ub9ac\uc2a4\ud2b8 \uc0dd\uc131, \uc785\ub825, \ucc3e\uae30 - Dozzing World\",\"isPartOf\":{\"@id\":\"https:\/\/blog.dozzing.kr\/#website\"},\"datePublished\":\"2023-01-23T08:32:10+00:00\",\"dateModified\":\"2025-10-24T09:10:51+00:00\",\"author\":{\"@id\":\"https:\/\/blog.dozzing.kr\/#\/schema\/person\/52258baef65b530d3e867e4c1f79c36f\"},\"breadcrumb\":{\"@id\":\"https:\/\/blog.dozzing.kr\/?p=1318#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.dozzing.kr\/?p=1318\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.dozzing.kr\/?p=1318#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.dozzing.kr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Python] 2\ucc28\uc6d0 \ub9ac\uc2a4\ud2b8 \uc0dd\uc131, \uc785\ub825, \ucc3e\uae30\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.dozzing.kr\/#website\",\"url\":\"https:\/\/blog.dozzing.kr\/\",\"name\":\"Dozzing World\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.dozzing.kr\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.dozzing.kr\/#\/schema\/person\/52258baef65b530d3e867e4c1f79c36f\",\"name\":\"Dozzing\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/blog.dozzing.kr\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0bbe3fe675c3641965411ffb61a1368b3bf05e794deaa3c7bd0ef7b4690a614a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0bbe3fe675c3641965411ffb61a1368b3bf05e794deaa3c7bd0ef7b4690a614a?s=96&d=mm&r=g\",\"caption\":\"Dozzing\"},\"sameAs\":[\"https:\/\/blog.dozzing.kr\/\"],\"url\":\"https:\/\/blog.dozzing.kr\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Python] 2\ucc28\uc6d0 \ub9ac\uc2a4\ud2b8 \uc0dd\uc131, \uc785\ub825, \ucc3e\uae30 - Dozzing World","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.dozzing.kr\/?p=1318","og_locale":"ko_KR","og_type":"article","og_title":"[Python] 2\ucc28\uc6d0 \ub9ac\uc2a4\ud2b8 \uc0dd\uc131, \uc785\ub825, \ucc3e\uae30 - Dozzing World","og_description":"\ud83d\udcab 2\ucc28\uc6d0 \ub9ac\uc2a4\ud2b8\ub780? matrix = [ [1, 2, 3], [4, 5, 6], [7, 8, 9] ] \ub9ac\uc2a4\ud2b8 \uc548\uc5d0 \ub610 \ub2e4\ub978 \ub9ac\uc2a4\ud2b8\uac00 \ub4e4\uc5b4\uc788\ub294 \uad6c\uc870 \ubcf4\ud1b5 \ud589(row)\uacfc \uc5f4(column) \ud615\ud0dc\uc758 \ub370\uc774\ud130\ub97c \ud45c\ud604\ud560 \ub54c \uc0ac\uc6a9 \ud83d\udcab 2\ucc28\uc6d0 \ub9ac\uc2a4\ud2b8 \uc0dd\uc131\ud558\uae30 # \uc9c1\uc811 \ucd08\uae30\ud654 matrix = [ [0, 0, 0], [0, 0, 0], [0, 0, 0] ] # List Comprehension \ud65c\uc6a9 [&hellip;]","og_url":"https:\/\/blog.dozzing.kr\/?p=1318","og_site_name":"Dozzing World","article_published_time":"2023-01-23T08:32:10+00:00","article_modified_time":"2025-10-24T09:10:51+00:00","author":"Dozzing","twitter_card":"summary_large_image","twitter_misc":{"\uae00\uc4f4\uc774":"Dozzing","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"2\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/blog.dozzing.kr\/?p=1318","url":"https:\/\/blog.dozzing.kr\/?p=1318","name":"[Python] 2\ucc28\uc6d0 \ub9ac\uc2a4\ud2b8 \uc0dd\uc131, \uc785\ub825, \ucc3e\uae30 - Dozzing World","isPartOf":{"@id":"https:\/\/blog.dozzing.kr\/#website"},"datePublished":"2023-01-23T08:32:10+00:00","dateModified":"2025-10-24T09:10:51+00:00","author":{"@id":"https:\/\/blog.dozzing.kr\/#\/schema\/person\/52258baef65b530d3e867e4c1f79c36f"},"breadcrumb":{"@id":"https:\/\/blog.dozzing.kr\/?p=1318#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.dozzing.kr\/?p=1318"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.dozzing.kr\/?p=1318#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.dozzing.kr\/"},{"@type":"ListItem","position":2,"name":"[Python] 2\ucc28\uc6d0 \ub9ac\uc2a4\ud2b8 \uc0dd\uc131, \uc785\ub825, \ucc3e\uae30"}]},{"@type":"WebSite","@id":"https:\/\/blog.dozzing.kr\/#website","url":"https:\/\/blog.dozzing.kr\/","name":"Dozzing World","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.dozzing.kr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Person","@id":"https:\/\/blog.dozzing.kr\/#\/schema\/person\/52258baef65b530d3e867e4c1f79c36f","name":"Dozzing","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/blog.dozzing.kr\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0bbe3fe675c3641965411ffb61a1368b3bf05e794deaa3c7bd0ef7b4690a614a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0bbe3fe675c3641965411ffb61a1368b3bf05e794deaa3c7bd0ef7b4690a614a?s=96&d=mm&r=g","caption":"Dozzing"},"sameAs":["https:\/\/blog.dozzing.kr\/"],"url":"https:\/\/blog.dozzing.kr\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=\/wp\/v2\/posts\/1318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1318"}],"version-history":[{"count":1,"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=\/wp\/v2\/posts\/1318\/revisions"}],"predecessor-version":[{"id":1319,"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=\/wp\/v2\/posts\/1318\/revisions\/1319"}],"wp:attachment":[{"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}