{"id":609,"date":"2020-05-24T17:24:17","date_gmt":"2020-05-24T08:24:17","guid":{"rendered":"http:\/\/www.mamacoding.com\/?p=609"},"modified":"2020-05-24T17:35:29","modified_gmt":"2020-05-24T08:35:29","slug":"python-%ed%8c%8c%ec%9d%b4%ec%8d%ac-%eb%b0%b0%ec%9a%b0%ea%b8%b04-%eb%b0%98%eb%b3%b5%eb%ac%b8%ed%95%a8%ec%88%98%ed%99%80%ec%88%98%ec%a7%9d%ec%88%98","status":"publish","type":"post","link":"http:\/\/www.mamacoding.com\/?p=609","title":{"rendered":"PYTHON \ud30c\uc774\uc36c \ubc30\uc6b0\uae304 &#8211; \ubc18\ubcf5\ubb38,\ud568\uc218,\ud640\uc218\uc9dd\uc218"},"content":{"rendered":"<div id=\"SE-8456c387-bc86-45d6-a884-792b6460d7a2\" class=\"se-component se-text se-l-default\">\n<div class=\"se-component-content\">\n<div class=\"se-section se-section-text se-l-default\">\n<div class=\"se-module se-module-text\">\n<h3>\ubc18\ubcf5\ubb38 <strong>for<\/strong><\/h3>\n<blockquote>\n<p class=\"se-text-paragraph se-text-paragraph-align- \"><strong>for<\/strong> a <strong>in<\/strong> [1, 2, 3]:<\/p>\n<p class=\"se-text-paragraph se-text-paragraph-align- \">&#8230; \u00a0\u00a0print(a)<\/p>\n<\/blockquote>\n<h3>\ubc18\ubcf5\ubb38 <strong>while<\/strong><\/h3>\n<blockquote>\n<p class=\"se-text-paragraph se-text-paragraph-align- \"><span style=\"color: #3366ff;\">&gt;&gt;&gt;<\/span> i = 0<\/p>\n<p class=\"se-text-paragraph se-text-paragraph-align- \"><strong>while<\/strong> i &lt; 3:<\/p>\n<p class=\"se-text-paragraph se-text-paragraph-align- \">&#8230; \u00a0\u00a0\u00a0\u00a0i=i+1<\/p>\n<p class=\"se-text-paragraph se-text-paragraph-align- \">&#8230; \u00a0\u00a0\u00a0\u00a0print(i)<\/p>\n<\/blockquote>\n<h3>\ud568\uc218<\/h3>\n<blockquote>\n<p class=\"se-text-paragraph se-text-paragraph-align- \"><strong>def<\/strong> <strong>add<\/strong>(a, b):<\/p>\n<p class=\"se-text-paragraph se-text-paragraph-align- \">&#8230; \u00a0\u00a0\u00a0\u00a0<strong>return<\/strong> a+b<\/p>\n<p class=\"se-text-paragraph se-text-paragraph-align- \"><span style=\"color: #3366ff;\">&gt;&gt;&gt;<\/span>\u00a0 add(3,4)<\/p>\n<\/blockquote>\n<p>\u203b \uc608\uc57d\uc5b4\ub780 \ud504\ub85c\uadf8\ub798\ubc0d \uc5b8\uc5b4\uc5d0\uc11c \uc774\ubbf8 \ubb38\ubc95\uc801\uc778 \uc6a9\ub3c4\ub85c \uc0ac\uc6a9\ud558\uace0 \uc788\ub294 \ub2e8\uc5b4\ub97c \ub9d0\ud55c\ub2e4.<\/p>\n<p>&nbsp;<\/p>\n<p id=\"SE-21e7013e-3310-40b0-9d31-fe6170914f93\" class=\"se-text-paragraph se-text-paragraph-align- \"><strong><span id=\"SE-54b189b1-4618-49ca-bf9d-f1a17725ca20\" class=\"se-fs- se-ff- \">** \ud30c\uc774\uc36c\uc5d0\uc11c \uc8fc\uc5b4\uc9c4 \uc790\uc5f0\uc218\uac00 \ud640\uc218\uc778\uc9c0 \uc9dd\uc218\uc778\uc9c0 \ud310\ubcc4\ud574 \ubcf4\uae30<\/span><\/strong><\/p>\n<p id=\"SE-e26a40da-2605-4670-ae58-83ae8d6a6c00\" class=\"se-text-paragraph se-text-paragraph-align- \"><span id=\"SE-4a1fa37c-3413-4ee0-84bf-8018bd5f39bb\" class=\"se-fs- se-ff- \">is_odd()\ub77c\ub294 \ud568\uc218\ub97c \ub9cc\ub4e0\ub2e4.<\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"SE-7112e154-55dc-47aa-8753-83efb7e366b3\" class=\"se-component se-table se-l-default\">\n<div class=\"se-component-content\">\n<div class=\"se-section se-section-table se-l-default se-section-align-\">\n<div class=\"se-table-container\">\n<table class=\"se-table-content\">\n<tbody>\n<tr class=\"se-tr\">\n<td class=\"se-cell\" colspan=\"3\" rowspan=\"1\">\n<div class=\"se-module se-module-text\">\n<p id=\"SE-5fdf0c72-c511-454a-ad2d-f422cc23336a\" class=\"se-text-paragraph se-text-paragraph-align- \"><span style=\"color: #800080;\"><span id=\"SE-2068541b-57ce-468b-aae3-42e8c403ddf2\" class=\"se-fs-fs15 se-ff- se-decoration-unset\">&gt;&gt;&gt; <\/span><span id=\"SE-90d62c47-5822-4c46-aaea-c6a5e3b924b6\" class=\"se-fs-fs15 se-ff- se-decoration-unset\"><b>def<\/b><\/span><span id=\"SE-a9432453-733e-4576-a238-c4f966f7bd9c\" class=\"se-fs-fs15 se-ff- se-decoration-unset\"> <\/span><span id=\"SE-8320d723-a348-4d72-9a4f-20fc320b01d0\" class=\"se-fs-fs15 se-ff- se-decoration-unset\"><b>is_odd<\/b><\/span><span id=\"SE-d37606a1-e724-4f30-a038-6f8eb4195de1\" class=\"se-fs-fs15 se-ff- se-decoration-unset\">(number):<\/span><\/span><\/p>\n<\/div>\n<div class=\"se-module se-module-text\">\n<p id=\"SE-12bc9390-9f54-4491-858f-460fafcef2c6\" class=\"se-text-paragraph se-text-paragraph-align-left \"><span style=\"color: #800080;\"><span id=\"SE-09582693-01f7-4768-9b5f-be9b61e0aedc\" class=\"se-fs-fs15 se-ff- se-decoration-unset\">&#8230; <\/span><span id=\"SE-d38b017d-f63c-4c41-9326-5ffb24676a2d\" class=\"se-fs-fs15 se-ff- se-decoration-unset\"> <\/span><span id=\"SE-8d87f3b5-446b-4199-94b7-70b38474ae65\" class=\"se-fs-fs15 se-ff- se-decoration-unset\"><b>if<\/b><\/span><span id=\"SE-1cd1f5ac-31cd-4d95-b6c3-7a06e5d1fcec\" class=\"se-fs-fs15 se-ff- se-decoration-unset\"> number % <\/span><span id=\"SE-1acb3bef-7f1b-4da4-9212-62c48647c8ae\" class=\"se-fs-fs15 se-ff- se-decoration-unset\">2<\/span><span id=\"SE-ccd7f6f4-fe1a-4537-9032-2cbc3a918b54\" class=\"se-fs-fs15 se-ff- se-decoration-unset\"> == <\/span><span id=\"SE-2d7db366-1b38-441f-83cc-9fc16f029003\" class=\"se-fs-fs15 se-ff- se-decoration-unset\">1<\/span><span id=\"SE-5f9259dc-c4b1-4354-b78d-3f3bdaefa5a1\" class=\"se-fs-fs15 se-ff- se-decoration-unset\">: <\/span><span id=\"SE-9c4352dd-2051-4f63-8078-9e7727e3ace2\" class=\"se-fs-fs15 se-ff- se-decoration-unset\"># 2\ub85c \ub098\ub204\uc5c8\uc744 \ub54c \ub098\uba38\uc9c0\uac00 1\uc774\uba74 \ud640\uc218\uc774\ub2e4.<\/span><\/span><\/p>\n<\/div>\n<div class=\"se-module se-module-text\">\n<p id=\"SE-ba2617e0-920a-4545-b034-0e40ba027473\" class=\"se-text-paragraph se-text-paragraph-align-left \"><span style=\"color: #800080;\"><span id=\"SE-3ec73fc2-7c08-45f2-9954-1afcacc3af0b\" class=\"se-fs-fs15 se-ff- se-decoration-unset\">&#8230; <\/span><span id=\"SE-bb0b2bdb-7f61-489b-96cd-be529efa824c\" class=\"se-fs-fs15 se-ff- se-decoration-unset\"> <\/span><span id=\"SE-9996ff39-ef0f-4e7c-9999-75e6b6e95ba2\" class=\"se-fs-fs15 se-ff- se-decoration-unset\"><b>return<\/b><\/span><span id=\"SE-2642cb10-cd79-45c9-bb5e-ca7e8e7657d9\" class=\"se-fs-fs15 se-ff- se-decoration-unset\"> <\/span><span id=\"SE-755b3f23-ae97-493e-8380-f88eb7373ec4\" class=\"se-fs-fs15 se-ff- se-decoration-unset\"><b>True<\/b><\/span><\/span><\/p>\n<\/div>\n<div class=\"se-module se-module-text\">\n<p id=\"SE-eacbc616-02ad-47a5-b686-2a3569fcf2ff\" class=\"se-text-paragraph se-text-paragraph-align-left \"><span style=\"color: #800080;\"><span id=\"SE-8c16980a-0c09-46bd-b5b2-360db0eb73da\" class=\"se-fs-fs15 se-ff- se-decoration-unset\">&#8230; <\/span><span id=\"SE-53911d3d-ee06-46bd-8aa6-6916c5128564\" class=\"se-fs-fs15 se-ff- se-decoration-unset\"> <\/span><span id=\"SE-658caf42-437d-4f70-bb58-96aef83d1e18\" class=\"se-fs-fs15 se-ff- se-decoration-unset\"><b>else<\/b><\/span><span id=\"SE-68a5361b-571f-4fa8-a43c-553bb50b4503\" class=\"se-fs-fs15 se-ff- se-decoration-unset\">:<\/span><\/span><\/p>\n<\/div>\n<div class=\"se-module se-module-text\">\n<p id=\"SE-f1c42fee-8617-48e9-82b7-a8f1e70f0032\" class=\"se-text-paragraph se-text-paragraph-align-left \"><span style=\"color: #800080;\"><span id=\"SE-a8c6e850-414a-45ea-b909-2d3154c752da\" class=\"se-fs-fs15 se-ff- se-decoration-unset\">&#8230; <\/span><span id=\"SE-3f4d1cf0-79f5-4ee6-ac33-2d5e1356f454\" class=\"se-fs-fs15 se-ff- se-decoration-unset\"> <\/span><span id=\"SE-d2d543df-2f10-4104-8aa1-f42eb8ab2b30\" class=\"se-fs-fs15 se-ff- se-decoration-unset\"><b>return<\/b><\/span><span id=\"SE-ba1ea365-d330-4791-aae6-8126ae73604c\" class=\"se-fs-fs15 se-ff- se-decoration-unset\"> <\/span><span id=\"SE-497c4d32-d39e-4016-9878-6be703a1b771\" class=\"se-fs-fs15 se-ff- se-decoration-unset\"><b>False<\/b><\/span><\/span><\/p>\n<\/div>\n<div class=\"se-module se-module-text\">\n<p id=\"SE-14842ed2-d310-422e-985d-543376397c6b\" class=\"se-text-paragraph se-text-paragraph-align-left \"><span id=\"SE-903d546f-71db-4ba8-ace1-aa1fb42deb2a\" class=\"se-fs-fs15 se-ff- se-decoration-unset\">\u200b<\/span><\/p>\n<\/div>\n<div class=\"se-module se-module-text\">\n<p id=\"SE-d0da86c1-0529-4b36-a35e-0f3f63a84229\" class=\"se-text-paragraph se-text-paragraph-align-left \"><span id=\"SE-005ce6f8-b1d1-4127-885b-6e829d8d7b13\" class=\"se-fs-fs15 se-ff- se-decoration-unset\">\u00a0<\/span><\/p>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"SE-c7e83a78-b8f8-47d3-9abc-4509771f8a62\" class=\"se-component se-text se-l-default\">\n<div class=\"se-component-content\">\n<div class=\"se-section se-section-text se-l-default\">\n<div class=\"se-module se-module-text\">\n<p id=\"SE-b666de46-2828-4b0b-85a1-9ede2c4cbf9e\" class=\"se-text-paragraph se-text-paragraph-align- \"><span id=\"SE-5831c1f2-ff0d-47d8-952e-8046875f78f0\" class=\"se-fs- se-ff- \">\uc2e4\ud589\ud654\uba74<\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"SE-9de52184-7200-44ef-a924-ca526683e942\" class=\"se-component se-table se-l-default\">\n<div class=\"se-component-content\">\n<div class=\"se-section se-section-table se-l-default se-section-align-\">\n<div class=\"se-table-container\">\n<table class=\"se-table-content\">\n<tbody>\n<tr class=\"se-tr\">\n<td class=\"se-cell\" colspan=\"3\" rowspan=\"1\">\n<div class=\"se-module se-module-text\">\n<p id=\"SE-8713895c-61d9-4f57-be7b-a60d8413c151\" class=\"se-text-paragraph se-text-paragraph-align- \"><span style=\"color: #800080;\"><span id=\"SE-f47d0d52-5e4a-49d5-9930-5e617c86a2b9\" class=\"se-fs-fs15 se-ff- se-decoration-unset\">&gt;&gt;&gt; <\/span><span id=\"SE-e64a7993-ff7a-40ae-bc25-c906bd4cd77b\" class=\"se-fs-fs15 se-ff- se-decoration-unset\">is_odd(<\/span><span id=\"SE-7670ecd9-9be5-48c1-9dbd-74e512e270c7\" class=\"se-fs-fs15 se-ff- se-decoration-unset\">3<\/span><span id=\"SE-fdf981a8-85f1-4c91-93eb-eeb5e10fcfee\" class=\"se-fs-fs15 se-ff- se-decoration-unset\">)<\/span><\/span><\/p>\n<\/div>\n<div class=\"se-module se-module-text\">\n<p id=\"SE-31d25679-2a30-4aa9-a9d9-e0efef4bc6d8\" class=\"se-text-paragraph se-text-paragraph-align-left \"><span id=\"SE-6b745c3d-25c8-433d-8bf2-88392bd47264\" class=\"se-fs-fs15 se-ff- se-decoration-unset\" style=\"color: #800080;\"><b>True<\/b><\/span><\/p>\n<\/div>\n<div class=\"se-module se-module-text\">\n<p id=\"SE-d1fae024-3bc7-422d-a5af-21d4e6087124\" class=\"se-text-paragraph se-text-paragraph-align-left \"><span style=\"color: #800080;\"><span id=\"SE-534ba84f-e463-434f-a622-04a2b91bc2fc\" class=\"se-fs-fs15 se-ff- se-decoration-unset\">&gt;&gt;&gt; <\/span><span id=\"SE-d40a3d77-a224-4167-b8a7-3f31f23baaa4\" class=\"se-fs-fs15 se-ff- se-decoration-unset\">is_odd(<\/span><span id=\"SE-ac02011b-b244-449a-a933-cd5b6f4eaafa\" class=\"se-fs-fs15 se-ff- se-decoration-unset\">4<\/span><span id=\"SE-57c3d79b-147d-41e0-a5ac-dc3ed714adab\" class=\"se-fs-fs15 se-ff- se-decoration-unset\">)<\/span><\/span><\/p>\n<\/div>\n<div class=\"se-module se-module-text\">\n<p id=\"SE-18bacb58-2862-413a-ada8-3ec04023ccf6\" class=\"se-text-paragraph se-text-paragraph-align- \"><span id=\"SE-bb3bb8aa-7a8e-4381-b61c-65bfa88f04b2\" class=\"se-fs-fs15 se-ff- se-decoration-unset\" style=\"color: #800080;\"><b>False<\/b><\/span><\/p>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"SE-62286265-0a7a-47c3-9d2b-9c57a1472d80\" class=\"se-component se-text se-l-default\">\n<div class=\"se-component-content\">\n<div class=\"se-section se-section-text se-l-default\">\n<div class=\"se-module se-module-text\">\n<p id=\"SE-0a7e6299-f344-4bda-9dde-ced60e3a9d4a\" class=\"se-text-paragraph se-text-paragraph-align- \"><span id=\"SE-5f8ee713-2abf-4fe1-b938-f395e255158c\" class=\"se-fs- se-ff- \">\u200b<\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\ubc18\ubcf5\ubb38 for for a in [1, 2, 3]: &#8230; \u00a0\u00a0print(a) \ubc18\ubcf5\ubb38 while &gt;&gt;&gt; i = 0 while i &lt; 3: &#8230; \u00a0\u00a0\u00a0\u00a0i=i+1 &#8230; \u00a0\u00a0\u00a0\u00a0print(i) \ud568\uc218 def add(a, b): &#8230; \u00a0\u00a0\u00a0\u00a0return a+b &gt;&gt;&gt;\u00a0 add(3,4) \u203b \uc608\uc57d\uc5b4\ub780 \ud504\ub85c\uadf8\ub798\ubc0d \uc5b8\uc5b4\uc5d0\uc11c \uc774\ubbf8 \ubb38\ubc95\uc801\uc778 \uc6a9\ub3c4\ub85c \uc0ac\uc6a9\ud558\uace0 \uc788\ub294 \ub2e8\uc5b4\ub97c \ub9d0\ud55c\ub2e4. &nbsp; ** \ud30c\uc774\uc36c\uc5d0\uc11c \uc8fc\uc5b4\uc9c4 \uc790\uc5f0\uc218\uac00 \ud640\uc218\uc778\uc9c0 \uc9dd\uc218\uc778\uc9c0 \ud310\ubcc4\ud574 \ubcf4\uae30 is_odd()\ub77c\ub294 \ud568\uc218\ub97c &hellip; <a href=\"http:\/\/www.mamacoding.com\/?p=609\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;PYTHON \ud30c\uc774\uc36c \ubc30\uc6b0\uae304 &#8211; \ubc18\ubcf5\ubb38,\ud568\uc218,\ud640\uc218\uc9dd\uc218&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[29],"tags":[32,36,38],"_links":{"self":[{"href":"http:\/\/www.mamacoding.com\/index.php?rest_route=\/wp\/v2\/posts\/609"}],"collection":[{"href":"http:\/\/www.mamacoding.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.mamacoding.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.mamacoding.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.mamacoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=609"}],"version-history":[{"count":2,"href":"http:\/\/www.mamacoding.com\/index.php?rest_route=\/wp\/v2\/posts\/609\/revisions"}],"predecessor-version":[{"id":615,"href":"http:\/\/www.mamacoding.com\/index.php?rest_route=\/wp\/v2\/posts\/609\/revisions\/615"}],"wp:attachment":[{"href":"http:\/\/www.mamacoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=609"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.mamacoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=609"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.mamacoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}