{"id":11684,"date":"2026-05-12T16:33:23","date_gmt":"2026-05-12T07:33:23","guid":{"rendered":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=11684"},"modified":"2026-05-12T16:36:54","modified_gmt":"2026-05-12T07:36:54","slug":"10%eb%85%84-%ec%a0%84-c-%ec%96%b8%ec%96%b4%eb%a5%bc-%ea%b3%b5%eb%b6%80%ed%95%9c-%eb%8b%b9%ec%8b%a0%ec%9d%84-%ec%9c%84%ed%95%9c-python-%ec%9e%85%eb%ac%b8-%ea%b0%80%ec%9d%b4%eb%93%9c","status":"publish","type":"post","link":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=11684","title":{"rendered":"10\ub144 \uc804 C \uc5b8\uc5b4\ub97c \uacf5\ubd80\ud55c \ub2f9\uc2e0\uc744 \uc704\ud55c Python \uc785\ubb38 \uac00\uc774\ub4dc"},"content":{"rendered":"<h1>10\ub144 \uc804 C \uc5b8\uc5b4\ub97c \uacf5\ubd80\ud55c \ub2f9\uc2e0\uc744 \uc704\ud55c Python \uc785\ubb38 \uac00\uc774\ub4dc<\/h1>\n<blockquote>\n<p>&quot;C\ub97c \uc54c\uc558\ub358 \ub098, Python\uc740 \uc5bc\ub9c8\ub098 \ub2e4\ub97c\uae4c?&quot;<br \/>\n\uacb0\ub860\ubd80\ud130 \ub9d0\ud558\uba74: <strong>\ud6e8\uc52c \uc27d\uace0, \ud6e8\uc52c \ube60\ub974\uace0, \ud6e8\uc52c \uc7ac\ubc0c\uc2b5\ub2c8\ub2e4.<\/strong><\/p>\n<\/blockquote>\n<hr \/>\n<h2>\ubaa9\ucc28<\/h2>\n<ol>\n<li><a href=\"#1-python\uc774\ub780-\ubb34\uc5c7\uc778\uac00\">Python\uc774\ub780 \ubb34\uc5c7\uc778\uac00?<\/a><\/li>\n<li><a href=\"#2-c\uc640-python-\ubb50\uac00-\ub2e4\ub978\uac00\">C\uc640 Python, \ubb50\uac00 \ub2e4\ub978\uac00?<\/a><\/li>\n<li><a href=\"#3-\uac1c\ubc1c-\ud658\uacbd-\uc124\uc815\">\uac1c\ubc1c \ud658\uacbd \uc124\uc815<\/a><\/li>\n<li><a href=\"#4-\uae30\ucd08-\ubb38\ubc95--c\uc640-\ube44\uad50\ud558\uba70-\ubc30\uc6b0\uae30\">\uae30\ucd08 \ubb38\ubc95 \u2014 C\uc640 \ube44\uad50\ud558\uba70 \ubc30\uc6b0\uae30<\/a><\/li>\n<li><a href=\"#5-\uc790\ub8cc\ud615\uacfc-\uceec\ub809\uc158\">\uc790\ub8cc\ud615\uacfc \uceec\ub809\uc158<\/a><\/li>\n<li><a href=\"#6-\ud568\uc218\">\ud568\uc218<\/a><\/li>\n<li><a href=\"#7-\ud30c\uc77c-\uc785\ucd9c\ub825\">\ud30c\uc77c \uc785\ucd9c\ub825<\/a><\/li>\n<li><a href=\"#8-\ud074\ub798\uc2a4\uc640-\uac1d\uccb4\uc9c0\ud5a5-\uc120\ud0dd\">\ud074\ub798\uc2a4\uc640 \uac1d\uccb4\uc9c0\ud5a5 (\uc120\ud0dd)<\/a><\/li>\n<li><a href=\"#9-python\ub9cc\uc758-\uac15\uc810--\ub77c\uc774\ube0c\ub7ec\ub9ac-\uc0dd\ud0dc\uacc4\">Python\ub9cc\uc758 \uac15\uc810 \u2014 \ub77c\uc774\ube0c\ub7ec\ub9ac \uc0dd\ud0dc\uacc4<\/a><\/li>\n<li><a href=\"#10-\ub2e4\uc74c-\ub2e8\uacc4\">\ub2e4\uc74c \ub2e8\uacc4<\/a><\/li>\n<\/ol>\n<hr \/>\n<h2>1. Python\uc774\ub780 \ubb34\uc5c7\uc778\uac00?<\/h2>\n<p>Python\uc740 1991\ub144\uc5d0 \ub4f1\uc7a5\ud55c <strong>\uc778\ud130\ud504\ub9ac\ud130 \uc5b8\uc5b4<\/strong>\uc785\ub2c8\ub2e4. \ucef4\ud30c\uc77c \uc5c6\uc774 \ucf54\ub4dc\ub97c \ubc14\ub85c \uc2e4\ud589\ud560 \uc218 \uc788\uace0, \ubb38\ubc95\uc774 \uc601\uc5b4 \ubb38\uc7a5\ucc98\ub7fc \uc77d\ud788\ub3c4\ub85d \uc124\uacc4\ub418\uc5c8\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc624\ub298\ub0a0 Python\uc740 \ub2e4\uc74c \ubd84\uc57c\uc5d0\uc11c \uc555\ub3c4\uc801\uc73c\ub85c \uc0ac\uc6a9\ub429\ub2c8\ub2e4:<\/p>\n<ul>\n<li><strong>\ub370\uc774\ud130 \ubd84\uc11d \/ \uba38\uc2e0\ub7ec\ub2dd<\/strong> (pandas, NumPy, TensorFlow)<\/li>\n<li><strong>\uc6f9 \ubc31\uc5d4\ub4dc<\/strong> (Django, FastAPI)<\/li>\n<li><strong>\uc790\ub3d9\ud654 \uc2a4\ud06c\ub9bd\ud2b8<\/strong> (\uc5c5\ubb34 \uc790\ub3d9\ud654, \ud06c\ub864\ub9c1)<\/li>\n<li><strong>\uacfc\ud559 \uc5f0\uad6c<\/strong> (\ubb3c\ub9ac, \ubc14\uc774\uc624, \uae08\uc735\uacf5\ud559)<\/li>\n<\/ul>\n<hr \/>\n<h2>2. C\uc640 Python, \ubb50\uac00 \ub2e4\ub978\uac00?<\/h2>\n<p>C\ub97c \uacf5\ubd80\ud588\ub358 \uae30\uc5b5\uc744 \ub5a0\uc62c\ub824 \ubcf4\uc138\uc694. Python\uc774 \uc5b4\ub5bb\uac8c \ub2e4\ub978\uc9c0 \ud55c\ub208\uc5d0 \ube44\uad50\ud574 \ubd05\uc2dc\ub2e4.<\/p>\n<table>\n<thead>\n<tr>\n<th>\ud56d\ubaa9<\/th>\n<th>C<\/th>\n<th>Python<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\uc2e4\ud589 \ubc29\uc2dd<\/td>\n<td>\ucef4\ud30c\uc77c \ud6c4 \uc2e4\ud589<\/td>\n<td>\uc778\ud130\ud504\ub9ac\ud130\uac00 \ubc14\ub85c \uc2e4\ud589<\/td>\n<\/tr>\n<tr>\n<td>\ubcc0\uc218 \uc120\uc5b8<\/td>\n<td>\ud0c0\uc785 \uba85\uc2dc \ud544\uc218 (<code>int x = 5;<\/code>)<\/td>\n<td>\ud0c0\uc785 \uc790\ub3d9 \ucd94\ub860 (<code>x = 5<\/code>)<\/td>\n<\/tr>\n<tr>\n<td>\uba54\ubaa8\ub9ac \uad00\ub9ac<\/td>\n<td>\uc9c1\uc811 \uad00\ub9ac (<code>malloc<\/code>, <code>free<\/code>)<\/td>\n<td>\uc790\ub3d9 (\uac00\ube44\uc9c0 \uceec\ub809\ud130)<\/td>\n<\/tr>\n<tr>\n<td>\uc138\ubbf8\ucf5c\ub860<\/td>\n<td>\ud544\uc218<\/td>\n<td>\uc5c6\uc74c<\/td>\n<\/tr>\n<tr>\n<td>\ube14\ub85d \uad6c\ubd84<\/td>\n<td><code>{ }<\/code><\/td>\n<td>\ub4e4\uc5ec\uc4f0\uae30(indentation)<\/td>\n<\/tr>\n<tr>\n<td>\ubb38\uc790\uc5f4 \ucc98\ub9ac<\/td>\n<td>\ubc88\uac70\ub85c\uc6c0 (<code>char[]<\/code>, <code>strlen<\/code>)<\/td>\n<td>\ub9e4\uc6b0 \uac04\ub2e8<\/td>\n<\/tr>\n<tr>\n<td>\ud3ec\uc778\ud130<\/td>\n<td>\ud575\uc2ec \uac1c\ub150<\/td>\n<td>\uc5c6\uc74c<\/td>\n<\/tr>\n<tr>\n<td>\uc18d\ub3c4<\/td>\n<td>\ub9e4\uc6b0 \ube60\ub984<\/td>\n<td>\ub290\ub9ac\uc9c0\ub9cc \uc0dd\uc0b0\uc131\uc774 \ub192\uc74c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote>\n<p><strong>\ud575\uc2ec \ub9c8\uc778\ub4dc\uc14b<\/strong>: C\ub294 &quot;\ucef4\ud4e8\ud130\uc5d0\uac8c \uc815\ud655\ud788 \ubb34\uc5c7\uc744 \ud558\ub77c&quot;\uace0 \uc9c0\uc2dc\ud569\ub2c8\ub2e4. Python\uc740 &quot;\ub0b4\uac00 \uc6d0\ud558\ub294 \uac8c \uc774\uac70\uc57c&quot;\ub77c\uace0 \ub9d0\ud569\ub2c8\ub2e4. \ucef4\ud4e8\ud130\uac00 \ub098\uba38\uc9c0\ub97c \uc54c\uc544\uc11c \ud569\ub2c8\ub2e4.<\/p>\n<\/blockquote>\n<hr \/>\n<h2>3. \uac1c\ubc1c \ud658\uacbd \uc124\uc815<\/h2>\n<h3>Python \uc124\uce58<\/h3>\n<p><a href=\"https:\/\/www.python.org\/downloads\/\">python.org<\/a>\uc5d0\uc11c \ucd5c\uc2e0 \ubc84\uc804(3.x)\uc744 \ub2e4\uc6b4\ub85c\ub4dc\ud569\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-bash\"># \uc124\uce58 \ud655\uc778\npython --version\n# Python 3.12.x \ucd9c\ub825\ub418\uba74 \uc131\uacf5<\/code><\/pre>\n<h3>\ucf54\ub4dc \uc5d0\ub514\ud130 \ucd94\ucc9c<\/h3>\n<ul>\n<li><strong>VS Code<\/strong> (\ucd94\ucc9c): \ubb34\ub8cc, \uac00\ubccd\uace0 Python \ud655\uc7a5 \uc9c0\uc6d0 \uc6b0\uc218<\/li>\n<li><strong>PyCharm Community<\/strong>: Python \uc804\uc6a9, \uae30\ub2a5\uc774 \ud48d\ubd80<\/li>\n<\/ul>\n<h3>\uccab \uc2e4\ud589 \u2014 \uc778\ud130\ub799\ud2f0\ube0c \ubaa8\ub4dc<\/h3>\n<p>C\uc5d0\ub294 \uc5c6\ub358 \uae30\ub2a5\uc785\ub2c8\ub2e4. \ud130\ubbf8\ub110\uc5d0 <code>python<\/code>\uc744 \uc785\ub825\ud558\uba74 \ubc14\ub85c \ucf54\ub4dc\ub97c \uccd0\ubcfc \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-python\">&gt;&gt;&gt; 2 + 3\n5\n&gt;&gt;&gt; print(&quot;Hello, World!&quot;)\nHello, World!\n&gt;&gt;&gt; exit()<\/code><\/pre>\n<hr \/>\n<h2>4. \uae30\ucd08 \ubb38\ubc95 \u2014 C\uc640 \ube44\uad50\ud558\uba70 \ubc30\uc6b0\uae30<\/h2>\n<h3>4-1. Hello World<\/h3>\n<pre><code class=\"language-c\">\/\/ main.c\n#include &lt;stdio.h&gt;\nint main() {\n    printf(&quot;Hello, World!\\n&quot;);\n    return 0;\n}<\/code><\/pre>\n<pre><code class=\"language-python\"># main.py\n# python main.py\nprint(&quot;Hello, World!&quot;)<\/code><\/pre>\n<p>\ud5e4\ub354 \ud30c\uc77c\ub3c4, <code>main()<\/code> \ud568\uc218\ub3c4, \uc138\ubbf8\ucf5c\ub860\ub3c4 \uc5c6\uc2b5\ub2c8\ub2e4. \ub531 \ud55c \uc904\uc785\ub2c8\ub2e4.<\/p>\n<hr \/>\n<h3>4-2. \ubcc0\uc218 \uc120\uc5b8<\/h3>\n<p>C\uc5d0\uc11c\ub294 \ud0c0\uc785\uc744 \ubc18\ub4dc\uc2dc \uc120\uc5b8\ud574\uc57c \ud588\uc2b5\ub2c8\ub2e4. Python\uc740 \uadf8\ub0e5 \uc4f0\uba74 \ub429\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-c\">\/* C *\/\nint age = 30;\nfloat height = 175.5;\nchar name[] = &quot;\ucca0\uc218&quot;;<\/code><\/pre>\n<pre><code class=\"language-python\"># Python\nage = 30\nheight = 175.5\nname = &quot;\ucca0\uc218&quot;\n\n# \ud0c0\uc785 \ud655\uc778\ub3c4 \uac00\ub2a5\nprint(type(age))     # &lt;class &#039;int&#039;&gt;\nprint(type(height))  # &lt;class &#039;float&#039;&gt;\nprint(type(name))    # &lt;class &#039;str&#039;&gt;<\/code><\/pre>\n<hr \/>\n<h3>4-3. \uc870\uac74\ubb38 (if\/else)<\/h3>\n<pre><code class=\"language-c\">\/* C *\/\nif (score &gt;= 90) {\n    printf(&quot;A\ub4f1\uae09\\n&quot;);\n} else if (score &gt;= 80) {\n    printf(&quot;B\ub4f1\uae09\\n&quot;);\n} else {\n    printf(&quot;C\ub4f1\uae09 \uc774\ud558\\n&quot;);\n}<\/code><\/pre>\n<pre><code class=\"language-python\"># Python \u2014 \uc911\uad04\ud638 \ub300\uc2e0 \ub4e4\uc5ec\uc4f0\uae30!\nif score &gt;= 90:\n    print(&quot;A\ub4f1\uae09&quot;)\nelif score &gt;= 80:       # &#039;else if&#039; \ub300\uc2e0 &#039;elif&#039;\n    print(&quot;B\ub4f1\uae09&quot;)\nelse:\n    print(&quot;C\ub4f1\uae09 \uc774\ud558&quot;)<\/code><\/pre>\n<blockquote>\n<p>\u26a0\ufe0f <strong>\ub4e4\uc5ec\uc4f0\uae30\uac00 \ubb38\ubc95\uc785\ub2c8\ub2e4.<\/strong> C\uc5d0\uc11c\ub294 \uc2a4\ud0c0\uc77c\uc774\uc5c8\uc9c0\ub9cc, Python\uc5d0\uc11c\ub294 \ub4e4\uc5ec\uc4f0\uae30\uac00 \ud2c0\ub9ac\uba74 \uc624\ub958\uac00 \ub0a9\ub2c8\ub2e4. \ud0ed(Tab) \ub610\ub294 \uc2a4\ud398\uc774\uc2a4 4\uce78\uc744 \uc77c\uad00\ub418\uac8c \uc0ac\uc6a9\ud558\uc138\uc694.<\/p>\n<\/blockquote>\n<hr \/>\n<h3>4-4. \ubc18\ubcf5\ubb38 (for \/ while)<\/h3>\n<pre><code class=\"language-c\">\/* C \u2014 for \ub8e8\ud504 *\/\nfor (int i = 0; i &lt; 5; i++) {\n    printf(&quot;%d\\n&quot;, i);\n}<\/code><\/pre>\n<pre><code class=\"language-python\"># Python \u2014 for \ub8e8\ud504\nfor i in range(5):      # 0, 1, 2, 3, 4\n    print(i)\n\n# range(1, 6) \u2192 1, 2, 3, 4, 5\n# range(0, 10, 2) \u2192 0, 2, 4, 6, 8 (2\uc529 \uc99d\uac00)<\/code><\/pre>\n<p>Python\uc758 <code>for<\/code>\ubb38\uc740 C\ubcf4\ub2e4 \ud6e8\uc52c \uac15\ub825\ud569\ub2c8\ub2e4. \ub9ac\uc2a4\ud2b8, \ubb38\uc790\uc5f4, \ud30c\uc77c \ub4f1 <strong>\ubaa8\ub4e0 \uc21c\ud68c \uac00\ub2a5\ud55c \uac1d\uccb4<\/strong>\ub97c \ubc14\ub85c \ub3cc\ub9b4 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-python\">fruits = [&quot;\uc0ac\uacfc&quot;, &quot;\ubc14\ub098\ub098&quot;, &quot;\ud3ec\ub3c4&quot;]\nfor fruit in fruits:\n    print(fruit)\n\n# \ubb38\uc790\uc5f4\ub3c4 \ud55c \uae00\uc790\uc529 \uc21c\ud68c\nfor char in &quot;Python&quot;:\n    print(char)<\/code><\/pre>\n<p><code>while<\/code>\ubb38\uc740 C\uc640 \uac70\uc758 \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-python\">count = 0\nwhile count &lt; 3:\n    print(count)\n    count += 1      # count++\ub294 Python\uc5d0 \uc5c6\uc74c, +=\ub97c \uc0ac\uc6a9<\/code><\/pre>\n<hr \/>\n<h3>4-5. \uc785\ucd9c\ub825<\/h3>\n<pre><code class=\"language-c\">\/* C *\/\nint n;\nscanf(&quot;%d&quot;, &amp;n);\nprintf(&quot;\uc785\ub825\uac12: %d\\n&quot;, n);<\/code><\/pre>\n<pre><code class=\"language-python\"># Python \u2014 \ud3ec\uc778\ud130(&amp;) \uc5c6\uc74c, \ud615\uc2dd \uc9c0\uc815\uc790(%d) \uc5c6\uc74c\nn = input(&quot;\uc22b\uc790\ub97c \uc785\ub825\ud558\uc138\uc694: &quot;)   # \ud56d\uc0c1 \ubb38\uc790\uc5f4\ub85c \ubc18\ud658\ub428\nn = int(n)                         # \uc815\uc218\ub85c \ubcc0\ud658 \ud544\uc694\nprint(f&quot;\uc785\ub825\uac12: {n}&quot;)              # f-string \ud3ec\ub9f7\ud305<\/code><\/pre>\n<p><strong>f-string<\/strong>\uc740 Python 3.6\ubd80\ud130 \uc9c0\uc6d0\ub418\ub294 \uac15\ub825\ud55c \ubb38\uc790\uc5f4 \ud3ec\ub9f7 \ubc29\uc2dd\uc785\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-python\">name = &quot;\ud64d\uae38\ub3d9&quot;\nage = 30\nprint(f&quot;\uc774\ub984: {name}, \ub098\uc774: {age}\uc0b4&quot;)\n# \ucd9c\ub825: \uc774\ub984: \ud64d\uae38\ub3d9, \ub098\uc774: 30\uc0b4\n\n# \uacc4\uc0b0\uc2dd\ub3c4 \ub123\uc744 \uc218 \uc788\uc74c\nprint(f&quot;10\ub144 \ud6c4 \ub098\uc774: {age + 10}\uc0b4&quot;)<\/code><\/pre>\n<hr \/>\n<h2>5. \uc790\ub8cc\ud615\uacfc \uceec\ub809\uc158<\/h2>\n<p>C\uc5d0\ub294 \ubc30\uc5f4\uacfc \uad6c\uc870\uccb4\uac00 \uc788\uc5c8\ub2e4\uba74, Python\uc5d0\ub294 \ub354 \ud48d\ubd80\ud55c \uc790\ub8cc\uad6c\uc870\uac00 \uae30\ubcf8 \ub0b4\uc7a5\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<h3>5-1. \ub9ac\uc2a4\ud2b8 (List) \u2014 \ubc30\uc5f4\uc758 \uc9c4\ud654\ud615<\/h3>\n<pre><code class=\"language-python\"># \uc120\uc5b8 \u2014 \ud06c\uae30 \uc9c0\uc815 \ubd88\ud544\uc694, \ud0c0\uc785 \ud63c\ud569 \uac00\ub2a5\nnumbers = [1, 2, 3, 4, 5]\nmixed = [1, &quot;hello&quot;, 3.14, True]\n\n# \uc778\ub371\uc2f1 \u2014 C\uc640 \ub3d9\uc77c (0\ubd80\ud130 \uc2dc\uc791)\nprint(numbers[0])    # 1\nprint(numbers[-1])   # 5 (\ub4a4\uc5d0\uc11c \uccab \ubc88\uc9f8!)\n\n# \uc2ac\ub77c\uc774\uc2f1 \u2014 C\uc5d0\ub294 \uc5c6\ub358 \uac15\ub825\ud55c \uae30\ub2a5\nprint(numbers[1:4])  # [2, 3, 4]\nprint(numbers[:3])   # [1, 2, 3]\nprint(numbers[::2])  # [1, 3, 5] (2\uce78\uc529 \uac74\ub108\ub700)\n\n# \ucd94\uac00\/\uc0ad\uc81c \u2014 \ub3d9\uc801 \ud06c\uae30 \uc870\uc808 \uc790\ub3d9\nnumbers.append(6)    # \ub05d\uc5d0 \ucd94\uac00\nnumbers.insert(0, 0) # 0\ubc88 \uc704\uce58\uc5d0 \uc0bd\uc785\nnumbers.remove(3)    # \uac12 3 \uc0ad\uc81c\npopped = numbers.pop()  # \ub9c8\uc9c0\ub9c9 \uc694\uc18c \uc81c\uac70 &amp; \ubc18\ud658\n\n# \uc720\uc6a9\ud55c \ud568\uc218\nprint(len(numbers))  # \uae38\uc774\nprint(sum(numbers))  # \ud569\uacc4\nprint(max(numbers))  # \ucd5c\ub300\uac12<\/code><\/pre>\n<h3>5-2. \ub515\uc154\ub108\ub9ac (Dictionary) \u2014 C\uc758 \uad6c\uc870\uccb4\uc640 \ube44\uc2b7<\/h3>\n<p>C\uc5d0\uc11c \uc5ec\ub7ec \uc18d\uc131\uc744 \ubb36\uc73c\ub824\uba74 <code>struct<\/code>\ub97c \uc0ac\uc6a9\ud588\uc8e0. Python\uc758 \ub515\uc154\ub108\ub9ac\ub294 \ud0a4-\uac12 \uc30d\uc73c\ub85c \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud569\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-python\">person = {\n    &quot;name&quot;: &quot;\ud64d\uae38\ub3d9&quot;,\n    &quot;age&quot;: 30,\n    &quot;job&quot;: &quot;\uac1c\ubc1c\uc790&quot;\n}\n\n# \uc811\uadfc\nprint(person[&quot;name&quot;])        # \ud64d\uae38\ub3d9\nprint(person.get(&quot;age&quot;))     # 30 (\uc5c6\uc73c\uba74 None \ubc18\ud658, \uc548\uc804)\n\n# \ucd94\uac00 \/ \uc218\uc815\nperson[&quot;email&quot;] = &quot;hong@email.com&quot;\nperson[&quot;age&quot;] = 31\n\n# \uc21c\ud68c\nfor key, value in person.items():\n    print(f&quot;{key}: {value}&quot;)<\/code><\/pre>\n<h3>5-3. \ud29c\ud50c (Tuple) \u2014 \uc218\uc815 \ubd88\uac00\ub2a5\ud55c \ub9ac\uc2a4\ud2b8<\/h3>\n<pre><code class=\"language-python\">point = (3, 5)       # \uc88c\ud45c\ucc98\ub7fc \ubcc0\uacbd\ud560 \ud544\uc694 \uc5c6\ub294 \ub370\uc774\ud130\nx, y = point         # \uc5b8\ud328\ud0b9 \u2014 \ub9e4\uc6b0 \ud3b8\ub9ac!\nprint(x, y)          # 3 5<\/code><\/pre>\n<h3>5-4. \uc9d1\ud569 (Set) \u2014 \uc911\ubcf5 \uc5c6\ub294 \uc790\ub8cc\uad6c\uc870<\/h3>\n<pre><code class=\"language-python\">nums = {1, 2, 3, 2, 1}  # \uc911\ubcf5 \uc790\ub3d9 \uc81c\uac70\nprint(nums)              # {1, 2, 3}\n\na = {1, 2, 3}\nb = {2, 3, 4}\nprint(a | b)   # \ud569\uc9d1\ud569: {1, 2, 3, 4}\nprint(a &amp; b)   # \uad50\uc9d1\ud569: {2, 3}\nprint(a - b)   # \ucc28\uc9d1\ud569: {1}<\/code><\/pre>\n<hr \/>\n<h2>6. \ud568\uc218<\/h2>\n<h3>\uae30\ubcf8 \ud568\uc218 \uc120\uc5b8<\/h3>\n<pre><code class=\"language-c\">\/* C *\/\nint add(int a, int b) {\n    return a + b;\n}<\/code><\/pre>\n<pre><code class=\"language-python\"># Python \u2014 \ud0c0\uc785 \uc120\uc5b8 \uc5c6\uc74c\ndef add(a, b):\n    return a + b\n\nresult = add(3, 5)  # 8<\/code><\/pre>\n<h3>\uae30\ubcf8\uac12 \ub9e4\uac1c\ubcc0\uc218<\/h3>\n<pre><code class=\"language-python\">def greet(name, greeting=&quot;\uc548\ub155\ud558\uc138\uc694&quot;):\n    print(f&quot;{greeting}, {name}\ub2d8!&quot;)\n\ngreet(&quot;\ucca0\uc218&quot;)           # \uc548\ub155\ud558\uc138\uc694, \ucca0\uc218\ub2d8!\ngreet(&quot;\uc601\ud76c&quot;, &quot;\ubc18\uac00\uc6cc\uc694&quot;)  # \ubc18\uac00\uc6cc\uc694, \uc601\ud76c\ub2d8!<\/code><\/pre>\n<h3>\uc5ec\ub7ec \uac12 \ubc18\ud658<\/h3>\n<p>C\uc5d0\uc11c\ub294 \uad6c\uc870\uccb4\ub098 \ud3ec\uc778\ud130\ub97c \uc368\uc57c \ud588\uc9c0\ub9cc, Python\uc740 \uc5ec\ub7ec \uac12\uc744 \uac04\ub2e8\ud788 \ubc18\ud658\ud569\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-python\">def min_max(numbers):\n    return min(numbers), max(numbers)\n\nlo, hi = min_max([3, 1, 5, 2, 4])\nprint(lo, hi)  # 1 5<\/code><\/pre>\n<h3>\ub78c\ub2e4 (\uc775\uba85 \ud568\uc218)<\/h3>\n<pre><code class=\"language-python\"># \uac04\ub2e8\ud55c \uc5f0\uc0b0\uc740 lambda\ub85c \ud55c \uc904\uc5d0\nsquare = lambda x: x ** 2\nprint(square(5))  # 25\n\n# \uc815\ub82c \uae30\uc900 \uc9c0\uc815\uc5d0 \uc790\uc8fc \uc4f0\uc784\npeople = [(&quot;\ucca0\uc218&quot;, 30), (&quot;\uc601\ud76c&quot;, 25), (&quot;\ubbfc\uc218&quot;, 35)]\npeople.sort(key=lambda p: p[1])  # \ub098\uc774 \uae30\uc900 \uc815\ub82c<\/code><\/pre>\n<hr \/>\n<h2>7. \ud30c\uc77c \uc785\ucd9c\ub825<\/h2>\n<p>C\uc758 <code>fopen<\/code>, <code>fclose<\/code>\ub97c \uae30\uc5b5\ud558\uc2dc\ub098\uc694? Python\uc5d0\uc11c\ub294 <code>with<\/code> \ubb38\uc744 \uc4f0\uba74 \ud30c\uc77c\uc744 \uc790\ub3d9\uc73c\ub85c \ub2eb\uc544\uc90d\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-c\">\/* C *\/\nFILE *f = fopen(&quot;data.txt&quot;, &quot;r&quot;);\nchar line[256];\nwhile (fgets(line, sizeof(line), f)) {\n    printf(&quot;%s&quot;, line);\n}\nfclose(f);<\/code><\/pre>\n<pre><code class=\"language-python\"># Python \u2014 with \ube14\ub85d \ub05d\ub098\uba74 \uc790\ub3d9\uc73c\ub85c \ud30c\uc77c \ub2eb\ud798\nwith open(&quot;data.txt&quot;, &quot;r&quot;, encoding=&quot;utf-8&quot;) as f:\n    content = f.read()         # \uc804\uccb4 \uc77d\uae30\n    # \ub610\ub294\n    lines = f.readlines()      # \uc904 \ub2e8\uc704 \ub9ac\uc2a4\ud2b8\ub85c \uc77d\uae30\n    # \ub610\ub294\n    for line in f:             # \uc904 \ub2e8\uc704 \uc21c\ud68c\n        print(line.strip())\n\n# \uc4f0\uae30\nwith open(&quot;output.txt&quot;, &quot;w&quot;, encoding=&quot;utf-8&quot;) as f:\n    f.write(&quot;\uccab \ubc88\uc9f8 \uc904\\n&quot;)\n    f.write(&quot;\ub450 \ubc88\uc9f8 \uc904\\n&quot;)<\/code><\/pre>\n<hr \/>\n<h2>8. \ud074\ub798\uc2a4\uc640 \uac1d\uccb4\uc9c0\ud5a5 (\uc120\ud0dd)<\/h2>\n<p>C\uc5d0\uc11c <code>struct<\/code>\ub85c \ub370\uc774\ud130\ub97c \ubb36\uc5c8\ub2e4\uba74, Python\uc758 <code>class<\/code>\ub294 \ub370\uc774\ud130\uc640 \ud568\uc218\ub97c \ud568\uaed8 \ubb36\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-python\">class Person:\n    def __init__(self, name, age):   # \uc0dd\uc131\uc790 (C\uc758 \ucd08\uae30\ud654 \ud568\uc218)\n        self.name = name\n        self.age = age\n\n    def introduce(self):\n        print(f&quot;\uc800\ub294 {self.name}\uc774\uace0, {self.age}\uc0b4\uc785\ub2c8\ub2e4.&quot;)\n\n    def birthday(self):\n        self.age += 1\n        print(f&quot;\uc0dd\uc77c \ucd95\ud558! \uc774\uc81c {self.age}\uc0b4\uc774 \ub418\uc5c8\uc2b5\ub2c8\ub2e4.&quot;)\n\n# \uc0ac\uc6a9\np = Person(&quot;\ud64d\uae38\ub3d9&quot;, 30)\np.introduce()   # \uc800\ub294 \ud64d\uae38\ub3d9\uc774\uace0, 30\uc0b4\uc785\ub2c8\ub2e4.\np.birthday()    # \uc0dd\uc77c \ucd95\ud558! \uc774\uc81c 31\uc0b4\uc774 \ub418\uc5c8\uc2b5\ub2c8\ub2e4.<\/code><\/pre>\n<blockquote>\n<p>\uac1d\uccb4\uc9c0\ud5a5\uc774 \ub0af\uc124\ub2e4\uba74 \ucc98\uc74c\uc5d4 \uac74\ub108\ub6f0\uc5b4\ub3c4 \ub429\ub2c8\ub2e4. \uc2a4\ud06c\ub9bd\ud2b8 \uc791\uc131\uc774\ub098 \ub370\uc774\ud130 \ubd84\uc11d\uc740 \ud074\ub798\uc2a4 \uc5c6\uc774\ub3c4 \ucda9\ubd84\ud569\ub2c8\ub2e4.<\/p>\n<\/blockquote>\n<hr \/>\n<h2>9. Python\ub9cc\uc758 \uac15\uc810 \u2014 \ub77c\uc774\ube0c\ub7ec\ub9ac \uc0dd\ud0dc\uacc4<\/h2>\n<p>Python\uc758 \uc9c4\uc9dc \uac15\uc810\uc740 \ubc29\ub300\ud55c \ub77c\uc774\ube0c\ub7ec\ub9ac\uc785\ub2c8\ub2e4. C\uc5d0\uc11c \uc9c1\uc811 \uad6c\ud604\ud574\uc57c \ud588\ub358 \uac83\ub4e4\uc744 \ud55c \uc904\ub85c \ud574\uacb0\ud569\ub2c8\ub2e4.<\/p>\n<h3>\ud328\ud0a4\uc9c0 \uc124\uce58 \u2014 pip<\/h3>\n<pre><code class=\"language-bash\">pip install pandas          # \ub370\uc774\ud130 \ubd84\uc11d\npip install requests        # HTTP \uc694\uccad\npip install matplotlib      # \uadf8\ub798\ud504<\/code><\/pre>\n<h3>\uc790\uc8fc \uc4f0\uc774\ub294 \ud45c\uc900 \ub77c\uc774\ube0c\ub7ec\ub9ac<\/h3>\n<pre><code class=\"language-python\"># os \u2014 \ud30c\uc77c\/\ub514\ub809\ud130\ub9ac \uc870\uc791\nimport os\nfiles = os.listdir(&quot;.&quot;)         # \ud604\uc7ac \ud3f4\ub354 \ud30c\uc77c \ubaa9\ub85d\nos.mkdir(&quot;\uc0c8\ud3f4\ub354&quot;)               # \ud3f4\ub354 \uc0dd\uc131\n\n# datetime \u2014 \ub0a0\uc9dc\/\uc2dc\uac04\nfrom datetime import datetime\nnow = datetime.now()\nprint(now.strftime(&quot;%Y-%m-%d %H:%M&quot;))  # 2025-01-15 14:30\n\n# random \u2014 \ub09c\uc218\nimport random\nprint(random.randint(1, 10))    # 1~10 \uc0ac\uc774 \uc815\uc218\nrandom.shuffle([1, 2, 3, 4, 5])\n\n# json \u2014 JSON \ud30c\uc2f1\nimport json\ndata = &#039;{&quot;name&quot;: &quot;\ud64d\uae38\ub3d9&quot;, &quot;age&quot;: 30}&#039;\nobj = json.loads(data)          # \ubb38\uc790\uc5f4 \u2192 \ub515\uc154\ub108\ub9ac\nprint(obj[&quot;name&quot;])              # \ud64d\uae38\ub3d9<\/code><\/pre>\n<h3>requests \u2014 \uc6f9\uc5d0\uc11c \ub370\uc774\ud130 \uac00\uc838\uc624\uae30<\/h3>\n<pre><code class=\"language-python\">import requests\n\nresponse = requests.get(&quot;https:\/\/api.github.com&quot;)\nprint(response.status_code)    # 200\ndata = response.json()         # JSON \uc751\ub2f5\uc744 \ub515\uc154\ub108\ub9ac\ub85c<\/code><\/pre>\n<p>C\uc5d0\uc11c \uc774 \uc791\uc5c5\uc744 \uc9c1\uc811 \uad6c\ud604\ud588\ub2e4\uba74 \uc218\ubc31 \uc904\uc774 \ud544\uc694\ud588\uc744 \uac83\uc785\ub2c8\ub2e4.<\/p>\n<hr \/>\n<h2>10. \ub2e4\uc74c \ub2e8\uacc4<\/h2>\n<h3>\ucd94\ucc9c \ud559\uc2b5 \uacbd\ub85c<\/h3>\n<pre><code>\uae30\ucd08 \ubb38\ubc95 \uc644\uc131\n    \u2193\n\uc2e4\uc2b5 \ud504\ub85c\uc81d\ud2b8 (\uc544\ub798 \uc911 \ud558\ub098 \uc120\ud0dd)\n    \u2193\n\uad00\ub828 \ub77c\uc774\ube0c\ub7ec\ub9ac \uc2ec\ud654\n    \u2193\n\ud3ec\ud2b8\ud3f4\ub9ac\uc624 \/ \uc2e4\ubb34 \uc801\uc6a9<\/code><\/pre>\n<h3>\uc785\ubb38\uc6a9 \ubbf8\ub2c8 \ud504\ub85c\uc81d\ud2b8 \uc544\uc774\ub514\uc5b4<\/h3>\n<table>\n<thead>\n<tr>\n<th>\ub09c\uc774\ub3c4<\/th>\n<th>\ud504\ub85c\uc81d\ud2b8<\/th>\n<th>\ud575\uc2ec \uae30\uc220<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u2b50<\/td>\n<td>\uac00\uacc4\ubd80 \ud14d\uc2a4\ud2b8 \ud30c\uc77c \uad00\ub9ac<\/td>\n<td>\ud30c\uc77c I\/O, \ub9ac\uc2a4\ud2b8<\/td>\n<\/tr>\n<tr>\n<td>\u2b50\u2b50<\/td>\n<td>\uc5d1\uc140 \ub370\uc774\ud130 \uc790\ub3d9 \uc815\ub9ac<\/td>\n<td>pandas<\/td>\n<\/tr>\n<tr>\n<td>\u2b50\u2b50<\/td>\n<td>\ub0a0\uc528 \uc815\ubcf4 \uac00\uc838\uc624\uae30<\/td>\n<td>requests, API<\/td>\n<\/tr>\n<tr>\n<td>\u2b50\u2b50\u2b50<\/td>\n<td>\uc6f9 \ud06c\ub864\ub7ec \ub9cc\ub4e4\uae30<\/td>\n<td>requests, BeautifulSoup<\/td>\n<\/tr>\n<tr>\n<td>\u2b50\u2b50\u2b50<\/td>\n<td>\uac04\ub2e8\ud55c REST API \uc11c\ubc84<\/td>\n<td>FastAPI<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\ucc38\uace0 \uc790\ub8cc<\/h3>\n<ul>\n<li><strong>\uacf5\uc2dd \ud29c\ud1a0\ub9ac\uc5bc<\/strong>: <a href=\"https:\/\/docs.python.org\/ko\/3\/tutorial\/\">docs.python.org\/ko<\/a><\/li>\n<li><strong>\uc810\ud504 \ud22c \ud30c\uc774\uc36c<\/strong>: \ud55c\uad6d\uc5b4 \ubb34\ub8cc \uc628\ub77c\uc778 \ucc45, \uc785\ubb38\uc790\uc5d0\uac8c \ucd5c\uace0<\/li>\n<li><strong>Python Tutor<\/strong>: \ucf54\ub4dc \uc2e4\ud589 \ud750\ub984\uc744 \uc2dc\uac01\ud654\ud574\uc8fc\ub294 \uc0ac\uc774\ud2b8<\/li>\n<\/ul>\n<hr \/>\n<h2>\ub9c8\uce58\uba70<\/h2>\n<p>10\ub144 \uc804 C\ub97c \uacf5\ubd80\ud558\uc168\ub2e4\uba74 \uc774\ubbf8 <strong>\ud504\ub85c\uadf8\ub798\ubc0d\uc758 \ud575\uc2ec \uac1c\ub150<\/strong>\uc778 \ubcc0\uc218, \uc870\uac74\ubb38, \ubc18\ubcf5\ubb38, \ud568\uc218\ub97c \uc54c\uace0 \uacc4\uc2ed\ub2c8\ub2e4. Python\uc740 \uadf8 \uc704\uc5d0\uc11c &quot;\uadc0\ucc2e\uc740 \uac83\ub4e4&quot;\uc744 \ub300\uc2e0 \ucc98\ub9ac\ud574\uc8fc\ub294 \uc5b8\uc5b4\uc785\ub2c8\ub2e4.<\/p>\n<p>\ucc98\uc74c\uc5d4 \ud3ec\uc778\ud130\ub3c4 \uc5c6\uace0, <code>malloc<\/code>\ub3c4 \uc5c6\uace0, \uc138\ubbf8\ucf5c\ub860\ub3c4 \uc5c6\ub294 \uac83\uc774 \uc5b4\uc0c9\ud558\uac8c \ub290\uaef4\uc9c8 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ud558\uc9c0\ub9cc \uadf8 \ub355\ubd84\uc5d0 <strong>&quot;\ubb34\uc5c7\uc744 \ub9cc\ub4e4\uace0 \uc2f6\uc740\uac00&quot;\uc5d0\ub9cc \uc9d1\uc911<\/strong>\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc791\uc740 \uc2a4\ud06c\ub9bd\ud2b8 \ud558\ub098\ubd80\ud130 \uc2dc\uc791\ud574 \ubcf4\uc138\uc694. C \uc2dc\uc808\uc758 \uae30\uc5b5\uc774 \uc0dd\uac01\ubcf4\ub2e4 \ud070 \ub3c4\uc6c0\uc774 \ub420 \uac83\uc785\ub2c8\ub2e4.<\/p>\n<hr \/>\n<p><em>\uc774 \uae00\uc774 \ub3c4\uc6c0\uc774 \ub418\uc168\ub098\uc694? \uad81\uae08\ud55c \uc810\uc740 \ub313\uae00\ub85c \ub0a8\uaca8\uc8fc\uc138\uc694!<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>10\ub144 \uc804 C \uc5b8\uc5b4\ub97c \uacf5\ubd80\ud55c \ub2f9\uc2e0\uc744 \uc704\ud55c Python \uc785\ubb38 \uac00\uc774\ub4dc &quot;C\ub97c \uc54c\uc558\ub358 \ub098, Python\uc740 \uc5bc\ub9c8\ub098 \ub2e4\ub97c\uae4c?&quot; \uacb0\ub860\ubd80\ud130 \ub9d0\ud558\uba74: \ud6e8\uc52c \uc27d\uace0, \ud6e8\uc52c \ube60\ub974\uace0, \ud6e8\uc52c \uc7ac\ubc0c\uc2b5\ub2c8\ub2e4. \ubaa9\ucc28 Python\uc774\ub780 \ubb34\uc5c7\uc778\uac00? C\uc640 Python, \ubb50\uac00 \ub2e4\ub978\uac00? \uac1c\ubc1c \ud658\uacbd \uc124\uc815 \uae30\ucd08 \ubb38\ubc95 \u2014 C\uc640 \ube44\uad50\ud558\uba70 \ubc30\uc6b0\uae30 \uc790\ub8cc\ud615\uacfc \uceec\ub809\uc158 \ud568\uc218 \ud30c\uc77c \uc785\ucd9c\ub825 \ud074\ub798\uc2a4\uc640 \uac1d\uccb4\uc9c0\ud5a5 (\uc120\ud0dd) Python\ub9cc\uc758 \uac15\uc810 \u2014 \ub77c\uc774\ube0c\ub7ec\ub9ac \uc0dd\ud0dc\uacc4 \ub2e4\uc74c \ub2e8\uacc4\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=11684\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-11684","post","type-post","status-publish","format-standard","hentry","category-devops"],"_links":{"self":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/11684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11684"}],"version-history":[{"count":2,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/11684\/revisions"}],"predecessor-version":[{"id":11686,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/11684\/revisions\/11686"}],"wp:attachment":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}