{"id":1388,"date":"2014-01-15T10:52:49","date_gmt":"2014-01-15T15:52:49","guid":{"rendered":"http:\/\/www.a2life.info\/w\/?p=1388"},"modified":"2014-01-15T10:58:24","modified_gmt":"2014-01-15T15:58:24","slug":"python%e3%81%ae%e9%96%a2%e6%95%b0%e5%ae%9a%e7%be%a9%e3%81%a8%e3%83%91%e3%83%a9%e3%83%a1%e3%83%bc%e3%82%bf%e3%83%bc","status":"publish","type":"post","link":"https:\/\/www.a2life.info\/w\/?p=1388","title":{"rendered":"Python\u306e\u95a2\u6570\u5b9a\u7fa9\u3068\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc"},"content":{"rendered":"<p>Python3 \u3092\u3044\u3058\u3063\u3066\u3044\u304f\u4e2d\u3067\u3001\u6c17\u304c\u4ed8\u3044\u305f\u3053\u3068\u3092\u3053\u306e\u30d7\u30ed\u30b0\u306b\u307c\u3061\u307c\u3061\u66f8\u304d\u7559\u3081\u3066\u304a\u3053\u3046\u3068\u601d\u3046\u3002<\/p>\n<p>Python\u306e\u95a2\u6570\u5b9a\u7fa9\u3067\u306f\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3082\u623b\u308a\u5024\u3082\u30bf\u30a4\u30d7\u3092\u6307\u5b9a\u3057\u306a\u3044\u3002C++,Java,Pascal\u306a\u3069\u306e\u77e5\u8b58\u306e\u3042\u308b\u5b66\u7fd2\u8005\u306b\u306f\u7570\u5e38\u306b\u898b\u3048\u308b\u304c\u3001Python \u306f\u3000loosely typed language \u306a\u3093\u3067\u3042\u308b\u3002<\/p>\n<pre>\r\n>>> def foo(a,b,c):\r\n\treturn a*100 + b*10 + c\r\n\r\n>>> foo(3,2,1)\r\n321\r\n<\/pre>\n<p>\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306b\u521d\u671f\u5024\u3092\u6301\u305f\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u3000\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u6307\u5b9a\u3057\u306a\u3044\u5834\u5408\u306f\u305d\u306e\u521d\u671f\u5024\u304c\u4f7f\u7528\u3055\u308c\u308b\u3002<\/p>\n<pre>\r\n>>> def bar(a=1, b=1, c=1):\r\n\treturn a*100 + b*10 + c\r\n\r\n>>> bar()\r\n111\r\n>>> bar(3)\r\n311\r\n>>> bar(3,4)\r\n341\r\n>>> bar(3,4,1)\r\n341\r\n<\/pre>\n<p>\u3055\u3089\u306b\u306f\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u660e\u793a\u3059\u308c\u3070\u3001\u30ab\u30c3\u30b3\u5185\u306b\u73fe\u308c\u308b\u9806\u5e8f\u3092\u6c17\u306b\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u308b\u3002<\/p>\n<pre>\r\n>>> foo (a=5,c=2,b=1)\r\n512\r\n>>> bar(c=3,b=2)\r\n123\r\n>>> bar(c=9)\r\n119\r\n>>> bar(c=6,b=4,a=2)\r\n246\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Python3 \u3092\u3044\u3058\u3063\u3066\u3044\u304f\u4e2d\u3067\u3001\u6c17\u304c\u4ed8\u3044\u305f\u3053\u3068\u3092\u3053\u306e\u30d7\u30ed\u30b0\u306b\u307c\u3061\u307c\u3061\u66f8\u304d\u7559\u3081\u3066\u304a\u3053\u3046\u3068\u601d\u3046\u3002 Python\u306e\u95a2\u6570\u5b9a\u7fa9\u3067\u306f\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3082\u623b\u308a\u5024\u3082\u30bf\u30a4\u30d7\u3092\u6307\u5b9a\u3057\u306a\u3044\u3002C++,Java,Pascal\u306a\u3069\u306e\u77e5\u8b58\u306e\u3042\u308b\u5b66\u7fd2\u8005\u306b\u306f\u7570\u5e38\u306b\u898b\u3048\u308b\u304c\u3001Python \u306f\u3000loosely typed language \u306a\u3093\u3067\u3042\u308b\u3002 >>> def foo(a,b,c): return a*100 + b*10 + c >>> foo(3,2,1) 321 \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306b\u521d\u671f\u5024\u3092\u6301\u305f\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u3000\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u6307\u5b9a\u3057\u306a\u3044\u5834\u5408\u306f\u305d\u306e\u521d\u671f\u5024\u304c\u4f7f\u7528\u3055\u308c\u308b\u3002 >>> def bar(a=1, b=1, c=1): return a*100 + b*10 + c >>> bar() 111 >>> bar(3) 311 >>> bar(3,4) 341 >>> bar(3,4,1) 341 \u3055\u3089\u306b\u306f\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u660e\u793a\u3059\u308c\u3070\u3001\u30ab\u30c3\u30b3\u5185\u306b\u73fe\u308c\u308b\u9806\u5e8f\u3092\u6c17\u306b\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u308b\u3002 >>> foo (a=5,c=2,b=1) 512 >>> bar(c=3,b=2) 123 >>> bar(c=9) 119 >>> bar(c=6,b=4,a=2) 246<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48],"tags":[41],"class_list":["post-1388","post","type-post","status-publish","format-standard","hentry","category-programming","tag-python"],"_links":{"self":[{"href":"https:\/\/www.a2life.info\/w\/index.php?rest_route=\/wp\/v2\/posts\/1388","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.a2life.info\/w\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.a2life.info\/w\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.a2life.info\/w\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.a2life.info\/w\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1388"}],"version-history":[{"count":2,"href":"https:\/\/www.a2life.info\/w\/index.php?rest_route=\/wp\/v2\/posts\/1388\/revisions"}],"predecessor-version":[{"id":1391,"href":"https:\/\/www.a2life.info\/w\/index.php?rest_route=\/wp\/v2\/posts\/1388\/revisions\/1391"}],"wp:attachment":[{"href":"https:\/\/www.a2life.info\/w\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.a2life.info\/w\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1388"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.a2life.info\/w\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}