{"id":841,"date":"2021-06-19T14:33:21","date_gmt":"2021-06-19T05:33:21","guid":{"rendered":"http:\/\/www.mamacoding.com\/?p=841"},"modified":"2021-06-19T14:34:23","modified_gmt":"2021-06-19T05:34:23","slug":"python%ed%8c%8c%ec%9d%b4%ec%8d%ac-%ec%b5%9c%eb%8c%80%ea%b3%b5%ec%95%bd%ec%88%98%ed%8c%a9%ed%86%a0%eb%a6%ac%ec%96%bc%ea%b3%84%ec%8a%b9-%ea%b5%ac%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"http:\/\/www.mamacoding.com\/?p=841","title":{"rendered":"Python(\ud30c\uc774\uc36c)- \ucd5c\ub300\uacf5\uc57d\uc218,\ud329\ud1a0\ub9ac\uc5bc(\uacc4\uc2b9) \uad6c\ud558\uae30"},"content":{"rendered":"<div id=\"SE-5dee4f86-b2e3-4d8b-bafe-9172286c66c3\" 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-81462caf-7663-4aa9-8faa-6fe24046c9b8\" class=\"se-text-paragraph se-text-paragraph-align- \"><span id=\"SE-5634dc67-53cf-48d5-80df-8678e10f5e12\" class=\"se-fs- se-ff- \"><b>1. \ucd5c\ub300\uacf5\uc57d\uc218 \uad6c\ud558\uae30<\/b><\/span><\/p>\n<p id=\"SE-1f2e08f6-f0ba-4c98-bac7-a1b5b7a4d0ab\" class=\"se-text-paragraph se-text-paragraph-align- \"><span id=\"SE-1be74c1a-5399-47a2-abbc-e47071a928ec\" class=\"se-fs- se-ff- \">\uc218\ud559\uc5d0\uc11c \ubc30\uc6b0\ub294 \ucd5c\ub300\uacf5\uc57d\uc218\ub294 \ub450 \uc218\uc758 \uacf5\ud1b5\ub41c \ucd5c\ub300 \uc57d\uc218\ub97c \uad6c\ud558\ub294 \uac83\uc785\ub2c8\ub2e4.<\/span><\/p>\n<p id=\"SE-3097219a-09c5-4f3a-8faf-0d41190ba427\" class=\"se-text-paragraph se-text-paragraph-align- \"><span id=\"SE-144194d4-b551-4cda-ba39-d68199781d9e\" class=\"se-fs- se-ff- \">\ud30c\uc774\uc36c\uc5d0\uc11c \ud568\uc218\ub85c \uad6c\ud574 \ubd05\uc2dc\ub2e4.<\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"SE-040b6fcc-19d0-4a82-8785-3011457ae6d6\" class=\"se-component se-table se-l-default __se-component\">\n<hr \/>\n<pre><strong>def find_gcd(a, b):\r\n    while(b != 0):\r\n        result = b\r\n        a, b = b, a % b\r\n    return result\r\n\r\nnum1 = 12\r\nnum2 = 8\r\nprint(\"\ucd5c\ub300\uacf5\uc57d\uc218 \uad6c\ud558\uae30: \", find_gcd(num1, num2))<\/strong><\/pre>\n<\/div>\n<p>\uc2e4\ud589 \ud654\uba74<\/p>\n<hr \/>\n<p><span style=\"color: #0000ff;\">\ucd5c\ub300\uacf5\uc57d\uc218 \uad6c\ud558\uae30:\u00a0 4<\/span><\/p>\n<hr \/>\n<p id=\"SE-7185c81f-0ea6-4e65-8006-2222772aa519\" class=\"se-text-paragraph se-text-paragraph-align- \"><span id=\"SE-1bb2f69e-24e7-4264-8dda-ed2fbe67671b\" class=\"se-fs- se-ff- \"><b>2. \ud329\ud1a0\ub9ac\uc5bc \uad6c\ud558\uae30<\/b><\/span><\/p>\n<p id=\"SE-3ad9314c-c2b5-4dba-a3cb-1c459ae38656\" class=\"se-text-paragraph se-text-paragraph-align- \"><span id=\"SE-5ad8cbd1-92ac-477c-a973-4e974553c9a2\" class=\"se-fs- se-ff- \">\uc608\ub97c \ub4e4\uc5b4<\/span><\/p>\n<p id=\"SE-c7d69cba-c7e1-4521-8f97-2d2fe2abd02a\" class=\"se-text-paragraph se-text-paragraph-align- \"><span id=\"SE-659b0e8f-d947-48dd-a343-a80269ec76c6\" class=\"se-fs- se-ff- \">5! = 5 * 4 * 3 *2 * 1 = 120 <\/span><\/p>\n<hr \/>\n<pre><strong>def fac(n):\r\n    result = 1\r\n    for i in range(1, n+1):\r\n        result *= i\r\n    return result\r\n\r\ndef fac_test(n):\r\n    if n &lt;= 1:\r\n        return 1\r\n    return n * fac(n-1)\r\n\r\nprint(\"\ud329\ud1a0\ub9ac\uc5bc \uad6c\ud558\uae30: \", fac_test(5))\r\nprint(\"\ud329\ud1a0\ub9ac\uc5bc \uad6c\ud558\uae30: \", fac_test(10))<\/strong><\/pre>\n<p>\uc2e4\ud589 \ud654\uba74<\/p>\n<hr \/>\n<div class=\"se-module se-module-text\">\n<p id=\"SE-26b1039e-9639-4c2b-afe0-3a8bdc9f5416\" class=\"se-text-paragraph se-text-paragraph-align- \"><span id=\"SE-54291b57-abd5-437b-88b4-37e8f7408936\" class=\"se-fs- se-ff- \" style=\"color: #0000ff;\">\ud329\ud1a0\ub9ac\uc5bc \uad6c\ud558\uae30:\u00a0 120<\/span><\/p>\n<\/div>\n<div class=\"se-module se-module-text\">\n<p id=\"SE-f3702e35-1434-4ab9-831a-9feb320fcfaa\" class=\"se-text-paragraph se-text-paragraph-align- \"><span id=\"SE-018e9ddc-e320-4cbb-9688-f52ad782a905\" class=\"se-fs- se-ff- \" style=\"color: #0000ff;\">\ud329\ud1a0\ub9ac\uc5bc \uad6c\ud558\uae30: 3628800<\/span><\/p>\n<hr \/>\n<p class=\"se-text-paragraph se-text-paragraph-align- \">\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>1. \ucd5c\ub300\uacf5\uc57d\uc218 \uad6c\ud558\uae30 \uc218\ud559\uc5d0\uc11c \ubc30\uc6b0\ub294 \ucd5c\ub300\uacf5\uc57d\uc218\ub294 \ub450 \uc218\uc758 \uacf5\ud1b5\ub41c \ucd5c\ub300 \uc57d\uc218\ub97c \uad6c\ud558\ub294 \uac83\uc785\ub2c8\ub2e4. \ud30c\uc774\uc36c\uc5d0\uc11c \ud568\uc218\ub85c \uad6c\ud574 \ubd05\uc2dc\ub2e4. def find_gcd(a, b): while(b != 0): result = b a, b = b, a % b return result num1 = 12 num2 = 8 print(&#8220;\ucd5c\ub300\uacf5\uc57d\uc218 \uad6c\ud558\uae30: &#8220;, find_gcd(num1, num2)) \uc2e4\ud589 \ud654\uba74 \ucd5c\ub300\uacf5\uc57d\uc218 \uad6c\ud558\uae30:\u00a0 4 2. \ud329\ud1a0\ub9ac\uc5bc \uad6c\ud558\uae30 \uc608\ub97c &hellip; <a href=\"http:\/\/www.mamacoding.com\/?p=841\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;Python(\ud30c\uc774\uc36c)- \ucd5c\ub300\uacf5\uc57d\uc218,\ud329\ud1a0\ub9ac\uc5bc(\uacc4\uc2b9) \uad6c\ud558\uae30&#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":[63,64],"_links":{"self":[{"href":"http:\/\/www.mamacoding.com\/index.php?rest_route=\/wp\/v2\/posts\/841"}],"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=841"}],"version-history":[{"count":2,"href":"http:\/\/www.mamacoding.com\/index.php?rest_route=\/wp\/v2\/posts\/841\/revisions"}],"predecessor-version":[{"id":843,"href":"http:\/\/www.mamacoding.com\/index.php?rest_route=\/wp\/v2\/posts\/841\/revisions\/843"}],"wp:attachment":[{"href":"http:\/\/www.mamacoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.mamacoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=841"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.mamacoding.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}