{"id":672,"date":"2020-12-01T16:15:00","date_gmt":"2020-12-01T07:15:00","guid":{"rendered":"https:\/\/ksrd.jp\/koubou\/wordpress\/?p=672"},"modified":"2021-01-25T12:52:00","modified_gmt":"2021-01-25T03:52:00","slug":"%e3%82%b3%e3%83%bc%e3%83%87%e3%82%a3%e3%83%b3%e3%82%b0%e8%a6%8f%e7%b4%84","status":"publish","type":"post","link":"https:\/\/ksrd.jp\/koubou\/wordpress\/2020\/12\/%e3%82%b3%e3%83%bc%e3%83%87%e3%82%a3%e3%83%b3%e3%82%b0%e8%a6%8f%e7%b4%84\/","title":{"rendered":"\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04"},"content":{"rendered":"\n<p>\u300c<a rel=\"noreferrer noopener\" href=\"https:\/\/pep8-ja.readthedocs.io\/ja\/latest\/\" target=\"_blank\">\uff50\uff45\uff50\uff18<\/a>\uff08Python Enhancement Proposal\uff09\u300d\u304b\u3089\u5177\u4f53\u4f8b\u3092\u5f15\u7528\u3059\u308b\u3002<br>\u3000\u3000\u5177\u4f53\u4f8b\u3092\u53c2\u8003\u306b\u3057\u3001\u958b\u767a\u74b0\u5883\u306b\u5373\u3057\u3066\u4fee\u6b63\u9858\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\uff11\uff0e\u30a4\u30f3\u30c7\u30f3\u30c8\u306e\u30b9\u30da\u30fc\u30b9\u6570\u3092\u63c3\u3048\u308b<\/h4>\n\n\n\n<p>\u3000\u300c\u30b9\u30da\u30fc\u30b9\u306f\uff14\u3064\u300d\u3067\u63c3\u3048\u308b\u3068\u3042\u308b\u304c\u300c\uff12\u3064\u300d\u3067\u554f\u984c\u306a\u3057\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>if num % 2 == 0:\n  msg = &quot;\u5076\u6570&quot;<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">\uff12\uff0e\uff11\u884c\u306e\u9577\u3055\u306f\uff17\uff19\u6587\u5b57\u307e\u3067<\/h4>\n\n\n\n<p>\u3000\u300c\uff17\uff19\u6587\u5b57\u4ee5\u5185\u300d\u306b\u5236\u9650\u3059\u308b\u3068\u3042\u308b\u304c\u3001\u8aad\u307f\u3084\u3059\u3055\u306e\u89b3\u70b9\u304b\u3089\u3082\u5236\u9650\u3092\u8a2d\u3051\u308b\u65b9\u304c\u3088\u3044\u3002\u884c\u306e\u9014\u4e2d\u3067\u306e\u6539\u884c\u306f\u300c\uff3c\uff08\u534a\u89d2\u30d0\u30c3\u30af\u30b9\u30e9\u30c4\u30b7\u30e5\uff09\u300d\u3092\u4f7f\u7528\u3059\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>print(100 + 200 + 300 +\\\n      400 + 500)<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">\uff13\uff0e\u6587\u5b57\u5217\u306e\u5f15\u7528\u7b26\u3092\u63c3\u3048\u308b<\/h4>\n\n\n\n<p>\u3000Python \u3067\u306f\u3001\u30b7\u30f3\u30b0\u30eb\u30b3\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u300c\u2019\u300d\u3067\u56f2\u307e\u308c\u305f\u6587\u5b57\u5217\u3068\u3001\u30c0\u30d6\u30eb\u30b3\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u300c\u201d\u300d\u3067\u56f2\u307e\u308c\u305f\u6587\u5b57\u5217\u306f\u540c\u3058\u3067\u6271\u3044\u3002\u3069\u3061\u3089\u304b\u306b\u63c3\u3048\u308b\u3002<br>\u3000\u6587\u5b57\u5217\u306e\u4e2d\u306b\u5f15\u7528\u7b26\u3092\u542b\u3080\u5834\u5408\u306f\u3001\u9006\u306e\u5f15\u7528\u7b26\u3092\u4f7f\u3046\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>str = &quot;\u62ec\u5f27\u306e\u4e2d\u306b\u3064\u3044\u3066\u306f\u30b3\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3&#39;\u3067\u56f2\u3080&quot;<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">\uff14\uff0e\u5f0f\u3084\u6587\u4e2d\u306e\u7a7a\u767d\u6587\u5b57<\/h4>\n\n\n\n<p>\u3000\u958b\u59cb\u62ec\u5f27\u3000\uff08\u3000\u306e\u76f4\u5f8c\u3084\u7d42\u4e86\u62ec\u5f27\u3000\uff09\u3000\u306e\u76f4\u524d\u306b\u306f\u7a7a\u767d\u6587\u5b57\u3092\u5165\u308c\u306a\u3044\u3002<br>\u3000\u30ab\u30f3\u30de\u3000\u3001\u3000\u3084\u30bb\u30df\u30b3\u30ed\u30f3\u3000\uff1a\u3000\u306e\u76f4\u524d\u306b\u306f\u7a7a\u767d\u6587\u5b57\u3092\u5165\u308c\u306a\u3044<br>\u3000\u30ab\u30f3\u30de\u3000\u3001\u3000\u3084\u30bb\u30df\u30b3\u30ed\u30f3\u3000\uff1a\u3000\u306e\u76f4\u5f8c\u306b\u306f\u7a7a\u767d\u6587\u5b57\u3092\u5165\u308c\u308b<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>print(&quot;\u7a7a\u767d\u6587\u5b57\u3092\u5165\u308c\u306a\u3044&quot;)\nprint(&quot;\u76f4\u524d\u306b\u306f\u5165\u308c\u306a\u3044&quot;, &quot;\u76f4\u5f8c\u306b\u306f\u5165\u308c\u308b&quot;)<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">\uff15\uff0e\u6f14\u7b97\u5b50\u306e\u524d\u5f8c\u306b\u7a7a\u767d\u6587\u5b57\u3092\u5165\u308c\u308b<\/h4>\n\n\n\n<p>\u3000\u898b\u6613\u3055\u306e\u89b3\u70b9\u3067\u7a7a\u767d\u6587\u5b57\u3092\u6f14\u7b97\u5b50\u306e\u524d\u5f8c\u306b\u5165\u308c\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>weight = height * height * 22<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">\uff16\uff0e\u7121\u99c4\u306a\u30b9\u30da\u30fc\u30b9\u306f\u5165\u308c\u306a\u3044<\/h4>\n\n\n\n<p>\u3000\u6700\u521d\u306f\u9805\u76ee\u304c\u63c3\u3063\u3066\u898b\u6613\u3044\u304c\u3001\u305d\u306e\u5f8c\u306e\u5909\u66f4\u3067\u9805\u76ee\u306e\u9577\u3055\u304c\u5909\u308f\u3063\u305f\u308a\u3059\u308b\u3068\u3001\u7d50\u679c\u7684\u306b\u6700\u521d\u306b\u5165\u308c\u305f\u30b9\u30da\u30fc\u30b9\u306f\u898b\u306b\u304f\u304f\u306a\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>#\n#\u3000\u60aa\u3044\u4f8b\nheight = 1.8\nbmi    = 22\nweight = height * height * 22\n#\n#\u3000\u826f\u3044\u4f8b\nheight = 1.8\nbmi = 22\nweight = height * height * 22<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">\uff17\uff0e\u30b9\u30e9\u30a4\u30b9\u306e\u30b3\u30ed\u30f3\u306e\u524d\u5f8c\u306b\u7a7a\u767d\u6587\u5b57\u306f\u5165\u308c\u306a\u3044<\/h4>\n\n\n\n<p>\u3000\u898b\u6613\u3055\u3092\u512a\u5148\u3055\u305b\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>list1[0:2]\nlist2[::2]\nlist3[4::-1]<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">\uff18\uff0eimport\u6587\u306f\u884c\u3092\u5206\u3051\u308b<\/h4>\n\n\n\n<p>\u3000\u53d6\u8fbc\u3080\u5185\u5bb9\u3092\u660e\u78ba\u306b\u3059\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>#\n#\u3000\u60aa\u3044\u4f8b\nimport item1, item2\n#\n#\u3000\u826f\u3044\u4f8b\nimport item1\nimport item2<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">\uff19\uff0e\u547d\u540d\u898f\u5247<\/h4>\n\n\n\n<p>\u3000\u95a2\u6570\u3084\u5909\u6570<br>\u3000\u3000\u5168\u3066\u5c0f\u6587\u5b57\u3092\u4f7f\u7528\u3059\u308b\u3002\u5358\u8a9e\u3068\u5358\u8a9e\u306f\u30a2\u30f3\u30c0\u30fc\u30b9\u30b3\u30a2\uff08_\uff09\u3067\u533a\u5207\u308b\u3002<br>\u3000\u5b9a\u6570<br>\u3000\u3000\u5168\u3066\u5927\u6587\u5b57\u3092\u4f7f\u7528\u3059\u308b\u3002\u5358\u8a9e\u3068\u5358\u8a9e\u306f\u30a2\u30f3\u30c0\u30fc\u30b9\u30b3\u30a2\uff08_\uff09\u3067\u533a\u5207\u308b\u3002<br>\u3000\u30af\u30e9\u30b9<br>\u3000\u3000\u5148\u982d\u4e00\u6587\u5b57\u3092\u5927\u6587\u5b57\u306b\u3059\u308b\u3002<br>\u3000\u305d\u306e\u4ed6<br>\u3000\u3000\u9069\u5b9c\u300cpep8\u300d\u3092\u53c2\u7167\u3057\u3066\u6c7a\u3081\u308b\u3002<br>\u3000\u3000<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u898f\u7d04\u306b\u7121\u7406\u77e2\u7406\u5408\u308f\u305b\u308b\u3053\u3068\u306a\u304f\u3001\u4e00\u8cab\u6027\u3092\u4fdd\u3064\u3053\u3068\u304c\u91cd\u8981\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,2],"tags":[20],"class_list":["post-672","post","type-post","status-publish","format-standard","hentry","category-9","category-2","tag-python"],"_links":{"self":[{"href":"https:\/\/ksrd.jp\/koubou\/wordpress\/wp-json\/wp\/v2\/posts\/672","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ksrd.jp\/koubou\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ksrd.jp\/koubou\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ksrd.jp\/koubou\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ksrd.jp\/koubou\/wordpress\/wp-json\/wp\/v2\/comments?post=672"}],"version-history":[{"count":0,"href":"https:\/\/ksrd.jp\/koubou\/wordpress\/wp-json\/wp\/v2\/posts\/672\/revisions"}],"wp:attachment":[{"href":"https:\/\/ksrd.jp\/koubou\/wordpress\/wp-json\/wp\/v2\/media?parent=672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ksrd.jp\/koubou\/wordpress\/wp-json\/wp\/v2\/categories?post=672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ksrd.jp\/koubou\/wordpress\/wp-json\/wp\/v2\/tags?post=672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}