{"id":1311,"date":"2018-10-15T22:45:39","date_gmt":"2018-10-15T13:45:39","guid":{"rendered":"https:\/\/python-introduction.com\/?p=1311"},"modified":"2018-10-15T22:45:39","modified_gmt":"2018-10-15T13:45:39","slug":"%e3%80%90python%e5%85%a5%e9%96%80%e3%80%91%e3%82%af%e3%83%ad%e3%83%bc%e3%82%b8%e3%83%a3%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6%e3%82%8f%e3%81%8b%e3%82%8a%e3%82%84%e3%81%99%e3%81%8f%e8%a7%a3%e8%aa%ac","status":"publish","type":"post","link":"https:\/\/python-introduction.com\/?p=1311","title":{"rendered":"\u3010Python\u5165\u9580\u3011\u30af\u30ed\u30fc\u30b8\u30e3\u306b\u3064\u3044\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac"},"content":{"rendered":"<p>\u3053\u306e\u8a18\u4e8b\u3067\u306fPython\u3067\u767b\u5834\u3059\u308b\u30af\u30ed\u30fc\u30b8\u30e3\u306b\u3064\u3044\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">\u76ee\u6b21<\/p><ul class=\"toc_list\"><li><a href=\"#Python\"><span class=\"toc_number toc_depth_1\">1<\/span> \u3010Python\u3011\u30af\u30ed\u30fc\u30b8\u30e3\u3068\u306f\uff1f<\/a><\/li><li><a href=\"#Python-2\"><span class=\"toc_number toc_depth_1\">2<\/span> \u3010Python\u3011\u30af\u30ed\u30fc\u30b8\u30e3\u306b\u3064\u3044\u3066\u4f8b\u984c\u3092\u4f7f\u3063\u3066\u89e3\u8aac<\/a><\/li><li><a href=\"#Python-3\"><span class=\"toc_number toc_depth_1\">3<\/span> \u3010Python\u3011\u30af\u30ed\u30fc\u30b8\u30e3\u3063\u3066\u3069\u3093\u306a\u6642\u306b\u4f7f\u3046\u306e\uff1f<\/a><\/li><\/ul><\/div>\n<h2><span id=\"Python\">\u3010Python\u3011\u30af\u30ed\u30fc\u30b8\u30e3\u3068\u306f\uff1f<\/span><\/h2>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/10\/pasokonkomatatonesan1014.jpg\" alt=\"python \u30af\u30ed\u30fc\u30b8\u30e3\" width=\"620\" height=\"341\" class=\"alignnone size-full wp-image-1276\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/10\/pasokonkomatatonesan1014.jpg 620w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/10\/pasokonkomatatonesan1014-300x165.jpg 300w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>\u3042\u306a\u305f\u306f\u30af\u30ed\u30fc\u30b8\u30e3\u3068\u805e\u3044\u3066<br \/>\n\u3069\u3046\u3044\u3046\u610f\u5473\u304b\u9023\u60f3\u3067\u304d\u307e\u3059\u304b\uff1f<\/p>\n<p>\u300c\uff1f\uff1f\uff1f\u300d\u3068\u3044\u3046\u611f\u3058\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<br \/>\n\u5b9f\u969b\u3001\u30af\u30ed\u30fc\u30b8\u30e3\u3068\u306f\u4f55\u304b\u3001\u5b9a\u7fa9\u3092\u8a18\u3059\u306e\u306f<br \/>\n\u3059\u3054\u304f\u96e3\u3057\u3044\u3067\u3059\u3002<\/p>\n<p>\u30af\u30ed\u30fc\u30b8\u30e3\u3068\u306f<br \/>\n\u95a2\u6570\u306e\u5185\u90e8\u306b\u4f5c\u3063\u305f\u5909\u6570\u306e\u540d\u524d\u89e3\u6c7a\u3092<br \/>\n\u305d\u306e\u95a2\u6570\u304c\u5ba3\u8a00\u3057\u305f\u6642\u306e\u30b9\u30b3\u30fc\u30d7\u306b\u3084\u3089\u305b\u308b\u3053\u3068\u3092\u3044\u3044\u307e\u3059\u3002<\/p>\n<p>\u5909\u6570\u3068\u30b9\u30b3\u30fc\u30d7\u306b\u3064\u3044\u3066\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=911\" target=\"blank\">\u3010Python\u5165\u9580\u3011\u5909\u6570\u306e\u30b9\u30b3\u30fc\u30d7\u3068\u306f\uff1f\u4f8b\u984c\u3092\u7528\u3044\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac<\/a><\/p>\n<p>\u3053\u3053\u3067\u306f\u7c21\u5358\u306b\u30b9\u30b3\u30fc\u30d7\u306b\u3064\u3044\u3066\u89e3\u8aac\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3059\u306d\u3002<br \/>\n\u30b9\u30b3\u30fc\u30d7\u3068\u306f\u5909\u6570\u306e\u7bc4\u56f2\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u300c\uff1f\uff1f\uff1f\u300d\u3068\u3044\u3046\u65b9\u3082\u591a\u3044\u3068\u601d\u3044\u307e\u3059\u306e\u3067<br \/>\n\u5b9f\u969b\u306b\u4f8b\u984c\u3092\u4f7f\u3063\u3066\u30af\u30ed\u30fc\u30b8\u30e3\u306b\u3064\u3044\u3066\u7406\u89e3\u3092\u6df1\u3081\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2><span id=\"Python-2\">\u3010Python\u3011\u30af\u30ed\u30fc\u30b8\u30e3\u306b\u3064\u3044\u3066\u4f8b\u984c\u3092\u4f7f\u3063\u3066\u89e3\u8aac<\/span><\/h2>\n<p>\u307e\u305a\u4f8b\u984c1\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c1\u3000\u30af\u30ed\u30fc\u30b8\u30e3\u306e\u4f8b\r\n\r\ndef sotogawa(a, b):\r\n    def utigawa():\r\n        return a + b\r\n    return utigawa\r\nc = sotogawa(100,200)\r\nd = c()\r\nprint(d)<\/pre>\n<p>\u4f8b\u984c1\u3092\u5b9f\u884c\u3059\u308b\u3068300\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3069\u3046\u3057\u3066\u4f8b\u984c1\u3092\u5b9f\u884c\u3059\u308b\u3068300\u3068\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3057\u3087\u3046\uff1f<\/p>\n<p>\u307e\u305a<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">c = sotogawa(100,200)<\/pre>\n<p>sotogawa\u306e100\u3068200\u3092\u5ba3\u8a00\u3057\u305f\u6642\u70b9\u3067<\/p>\n<p>\u6700\u521d\u306e<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">def sotogawa(a, b):<\/pre>\n<p>sotogawa\u3068\u3044\u3046\u95a2\u6570\u3092\u5b9a\u7fa9\u3057\u305f\u6642\u306ea\u3068b\u306b100\u3068200\u304c\u5165\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u304b\u3089<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">    def utigawa():\r\n        return a + b<\/pre>\n<p>\u306f\u95a2\u6570\u5185\u95a2\u6570\u3067\u3059\u306d\u3002<\/p>\n<p>\u95a2\u6570\u5185\u95a2\u6570\u306b\u3064\u3044\u3066\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3067\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=1308\" target=\"blank\">\u3010Python\u5165\u9580\u3011\u95a2\u6570\u5185\u95a2\u6570\u306e\u5229\u7528\u6cd5<\/a><\/p>\n<p>\u3067\u3001\u95a2\u6570\u5185\u95a2\u6570\u3067\u3042\u308b<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">    def utigawa():\r\n        return a + b<\/pre>\n<p>\u3067\u3082\u3001100+200\u306f\u5165\u308b\u308f\u3051\u306a\u3093\u3067\u3059\u304c\u3001<br \/>\n\u3053\u306eutigawa\u3068\u3044\u3046\u95a2\u6570\u306f\u5b9f\u884c\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n<p>\u306a\u305c\u306a\u3089\u3053\u306e<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">    return utigawa<\/pre>\n<p>\u306f\u3001utigawa()\u307f\u305f\u3044\u306b()\u304c\u306a\u3044\u3067\u3059\u306d\u3002<br \/>\n()\u304c\u306a\u3044\u3068\u5b9f\u884c\u3055\u308c\u306a\u3044\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u3067\u3001<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">d = c()<\/pre>\n<p>\u3068c()\u3068\u3044\u3046\u5f62\u3067\u5b9f\u884c\u3055\u308c\u3066\u521d\u3081\u3066<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">    def utigawa():\r\n        return a + b<\/pre>\n<p>\u304c\u5b9f\u884c\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308b\u3093\u3067\u3059\u3002<\/p>\n<p>\u3067\u3001\u5b9f\u884c\u3055\u308c\u305f\u6642\u306b<br \/>\n100\uff0b200\uff1d300\u3068\u306a\u308a\u3001<\/p>\n<p>\u3053\u306e300\u304c<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">d = c()<\/pre>\n<p>\u306b\u3088\u3063\u3066\u5909\u6570d\u306b\u5165\u308a<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">print(d)<\/pre>\n<p>\u306b\u3088\u3063\u3066\u3001300\u3068\u8868\u793a\u3055\u308c\u305f\u3093\u3067\u3059\u3002<\/p>\n<p>\u304b\u306a\u308a\u3084\u3084\u3053\u3057\u3044\u3067\u3059\u306d\u3002<\/p>\n<h2><span id=\"Python-3\">\u3010Python\u3011\u30af\u30ed\u30fc\u30b8\u30e3\u3063\u3066\u3069\u3093\u306a\u6642\u306b\u4f7f\u3046\u306e\uff1f<\/span><\/h2>\n<p>\u4f8b\u984c1\u3092\u518d\u5ea6\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c1\u3000\u30af\u30ed\u30fc\u30b8\u30e3\u306e\u4f8b\r\n\r\ndef sotogawa(a, b):\r\n    def utigawa():\r\n        return a + b\r\n    return utigawa\r\nc = sotogawa(100,200)\r\nd = c()\r\nprint(d)<\/pre>\n<p>\u305f\u3068\u3048\u3070\u3001<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">c = sotogawa(100,200)<\/pre>\n<p>\u306e\u3068\u3053\u308d\u3067\u3001100\uff0b200\u3092\u4eca\u3059\u3050\u5b9f\u884c\u3057\u305f\u304f\u306a\u3044\u6642\u304c\u3042\u3063\u305f\u3068\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">c = sotogawa(100,200)<\/pre>\n<p>\u306e\u4e0b\u306b\u3082\u3001\u3055\u3089\u306b\u3044\u308d\u3093\u306a\u51e6\u7406\u304c\u5165\u3063\u3066\u3044\u308b\u3051\u3069\u3001<br \/>\n\u305d\u3046\u3044\u3063\u305f\u3044\u308d\u3093\u306a\u51e6\u7406\u304c\u7d42\u308f\u3063\u305f\u5f8c\u306b<br \/>\n\u843d\u3061\u7740\u3044\u3066<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">c = sotogawa(100,200)<\/pre>\n<p>\u306e\u8a08\u7b97\u3092\u3057\u305f\u3044\u5834\u5408\u306b\u3001\u4f8b\u984c1\u306e\u3088\u3046\u306a\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u304c\u884c\u308f\u308c\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0a\u3067\u89e3\u8aac\u3092\u7d42\u308f\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u3053\u306e\u8a18\u4e8b\u3067\u306fPython\u3067\u767b\u5834\u3059\u308b\u30af\u30ed\u30fc\u30b8\u30e3\u306b\u3064\u3044\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002 \u76ee\u6b211 \u3010Python\u3011\u30af\u30ed\u30fc\u30b8\u30e3\u3068\u306f\uff1f2 \u3010Python\u3011\u30af\u30ed\u30fc\u30b8\u30e3\u306b\u3064\u3044\u3066\u4f8b\u984c\u3092\u4f7f\u3063\u3066\u89e3\u8aac3 \u3010Python\u3011\u30af\u30ed\u30fc\u30b8\u30e3\u3063\u3066\u3069\u3093\u306a\u6642\u306b\u4f7f\u3046 [&hellip;]","protected":false},"author":1,"featured_media":1285,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,39],"tags":[3,138],"_links":{"self":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1311"}],"collection":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1311"}],"version-history":[{"count":3,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1311\/revisions"}],"predecessor-version":[{"id":1314,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1311\/revisions\/1314"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/media\/1285"}],"wp:attachment":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}