{"id":121,"date":"2019-11-15T15:58:54","date_gmt":"2019-11-15T06:58:54","guid":{"rendered":"http:\/\/aiacademy.jp\/media\/?p=121"},"modified":"2023-03-31T16:17:16","modified_gmt":"2023-03-31T07:17:16","slug":"%e3%80%90%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91%e3%80%91%e5%a4%89%e6%95%b0%e3%81%a8%e3%81%af%e4%bd%95%e3%81%8b%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/aiacademy.jp\/media\/?p=121","title":{"rendered":"\u3010\u521d\u5fc3\u8005\u5411\u3051\u3011\u5909\u6570\u3068\u306f\u4f55\u304b\uff1f"},"content":{"rendered":"<div class=\"toc\">    <div id=\"toc_container\" class=\"sgb-toc--no-bullets js-smooth-scroll\" data-dialog-title=\"Table of Contents\">\n      <p class=\"toc_title\">\u76ee\u6b21 <\/p>\n      <ul class=\"toc_list\">  <li class=\"first\">    <a href=\"#i-0\">\u5909\u6570<\/a>  <\/li>  <li>    <a href=\"#i-1\"><\/a>  <\/li>  <li>    <a href=\"#i-2\">\u5909\u6570\u3092\u4f7f\u308f\u306a\u3044\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u4f7f\u3063\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u6bd4\u8f03<\/a>  <\/li>  <li>    <a href=\"#i-3\">\u5b9a\u6570<\/a>  <\/li>  <li>    <a href=\"#i-4\">\u4e88\u7d04\u8a9e<\/a>  <\/li>  <li class=\"last\">    <a href=\"#i-5\">\u307e\u3068\u3081<\/a>  <\/li><\/ul>\n      \n    <\/div><\/div><div class=\"toc\"><p><\/p>\n<\/div><h2 id=\"i-0\">\u5909\u6570<\/h2>\n<p><strong>\u5909\u6570\u3068\u306f\u5024\u306b\u4ed8\u3051\u308b\u540d\u672d\u3067\u3059\u3002<\/strong><br>\u307e\u305f\u3001\u5909\u6570\u306f\u540d\u524d\u3092\u4ed8\u3051\u3066\u4f7f\u3044\u307e\u3059\u3002\u3053\u306e\u540d\u524d\u3092\u5909\u6570\u540d\u3068\u8a00\u3044\u307e\u3059\u3002<br>\u5024\u306f\u3001\u6570\u5024\u3067\u3082\u6587\u5b57\u5217\u3067\u3082\u5165\u308c\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<pre><code>lang = \"Python\" # \u5909\u6570lang\u306b\u6587\u5b57\u5217Python\u3092\u4ee3\u5165 \n<\/code><\/pre>\n<p>\u5909\u6570\u306e\u540d\u524d\uff08lang\uff09\u306f\u81ea\u7531\u306b\u6c7a\u3081\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002<br>\u4ee3\u5165\u3068\u3044\u3046\u8a00\u8449\u304c\u51fa\u3066\u304d\u307e\u3057\u305f\u304c\u3001<strong>\u4ee3\u5165\u3068\u306f\u5de6\u8fba\u306e\u5909\u6570\u306b\u53f3\u8fba\u306e\u5024\u3092\u5909\u6570\u306b\u5165\u308c\u308b\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\u3002<\/strong><br>\u307e\u305fPython\u306f\u3001<strong>\u5909\u6570\u540d\u306f\u5927\u6587\u5b57\u3068\u5c0f\u6587\u5b57\u306f\u533a\u5225\u3055\u308c\u307e\u3059\u3002<\/strong><br>\u305d\u3057\u3066\u3001<strong>\u5909\u6570\u306b\u4fdd\u6301\u3057\u305f\u5024\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u7d42\u4e86\u3059\u308b\u307e\u3067\u5024\u3092\u4fdd\u6301\u3057\u307e\u3059\u3002<\/strong><br>\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u7d42\u4e86\u3059\u308b\u3053\u3068\u3067\u30e1\u30e2\u30ea\u4e0a\u306e\u30c7\u30fc\u30bf\u3082\u6d88\u53bb\u3055\u308c\u308b\u305f\u3081\u3001\u30c7\u30fc\u30bf\u3092\u6b8b\u3057\u3066\u304a\u304d\u305f\u3044\u5834\u5408\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3084\u30d5\u30a1\u30a4\u30eb\u306b\u3057\u3066\u4fdd\u5b58\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre><code>var = \"var\"\nVar = \"Var\"\nprint(var) # var\u3068\u51fa\u529b\u3055\u308c\u308b\nprint(Var) # Var\u3068\u51fa\u529b\u3055\u308c\u308b\n\n# Python\u3067\u5909\u6570\u540d\u3092\u3064\u3051\u308b\u969b\u306b\uff12\u5358\u8a9e\u7d9a\u3051\u308b\u5834\u5408\nlowercase_underscore = \"lowercase_underscore\" # \u63a8\u5968\nlowercaseunderscore = \"lowercase_underscore\"  # \u975e\u63a8\u5968\n\nhello_world = \"Hello, World\" # \u63a8\u5968\nhelloworld  = \"Hello, World\" # \u975e\u63a8\u5968\n\n\"\"\"\n\u4e0a\u8a18\u306e\u3088\u3046\u306b\u5c0f\u6587\u5b57\u3067\u4e0b\u7dda(_)\u3092\u631f\u3080\u3068\u8a00\u3046\u6c7a\u307e\u308a\u304c\u63a8\u5968\u3055\u308c\u3066\u3044\u307e\u3059\u3002\n\u307e\u305f\u975e\u63a8\u5968\u306e\u66f8\u304d\u65b9\u3067\u3001\u5909\u6570\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3057\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u306f\u30a8\u30e9\u30fc\u306f\u51fa\u307e\u305b\u3093\u304c\u3001\n\u63a8\u5968\u3055\u308c\u3066\u3044\u308b\u65b9\u6cd5\u3092\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002\n\"\"\"\n\n<\/code><\/pre>\n<h2 id=\"i-1\"><code><a href=\"https:\/\/aiacademy.jp\/bootcamp\"><img decoding=\"async\" src=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2021\/12\/bootcamp_banner2.png\"><\/a><\/code><\/h2>\n<h2 id=\"i-2\">\u5909\u6570\u3092\u4f7f\u308f\u306a\u3044\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u4f7f\u3063\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u6bd4\u8f03<\/h2>\n<p>\u5909\u6570\u3092\u4f7f\u308f\u306a\u3044\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u4f7f\u3063\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u6bd4\u3079\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br>\u3053\u3053\u3067\u306f\u3001\u5909\u6570\u304c\u3069\u308c\u3060\u3051\u4fbf\u5229\u306a\u3082\u306e\u306a\u306e\u304b\u3092\u77e5\u3063\u3066\u9802\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br>\u307e\u305a\u306f\u3001\u5909\u6570\u3092\u4f7f\u308f\u306a\u3044\u5834\u5408\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><code>print(15 + 1)\nprint(15 - 2)\nprint(15 * 3)\nprint(15 \/ 4)\nprint(15 % 5)\n<\/code><\/pre>\n<p>\u3067\u306f15\u3092220\u306b\u66f8\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002<br>\u3082\u3057\u3053\u306e\u5834\u5408\u300115\u3068\u66f8\u304b\u308c\u305f5\u3064\u306eprint\u306e\u90e8\u5206\u3092\u5168\u3066220\u306b\u66f8\u304d\u63db\u3048\u308b\u5fc5\u8981\u304c\u51fa\u3066\u304d\u307e\u3059\u3002<br>5\u884c\u3060\u3051\u306a\u3089\u307e\u3060\u305d\u3053\u307e\u3067\u5927\u5909\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u4f8b\u3048\u3070100\u884c\u30011000\u884c\u3060\u3068\u3069\u3046\u3067\u3057\u3087\u3046\u304b\uff1f<br>1\u30641\u3064\u5909\u66f4\u3057\u3066\u3044\u304f\u306e\u306f\u304b\u306a\u308a\u9aa8\u306e\u6298\u308c\u308b\u4f5c\u696d\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306a\u6642\u3053\u305d\u3001\u5909\u6570\u304c\u5f79\u7acb\u3061\u307e\u3059\u3002<br>\u3082\u3057\u3082\u6700\u521d\u304b\u3089\u5909\u6570x\u3068\u3044\u3046\u3082\u306e\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u305f\u3089\u3001<br>x = 15\u3068\u3044\u3046\u306e\u3092\u3001x = 220\u306b\u66f8\u304d\u63db\u3048\u308b\u3060\u3051\u3067\u6e08\u307f\u307e\u3059\u3002<\/p>\n<pre><code>x = 220\nprint(x + 1)\nprint(x - 2)\nprint(x * 3)\nprint(x \/ 4)\nprint(x % 5)\n<\/code><\/pre>\n<p><strong><em>\u5909\u6570\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u5148\u307b\u3069\u306f5\u884c\u5206\u306e\u4fee\u6b63\u304c\u5fc5\u8981\u3060\u3063\u305f\u3082\u306e\u304c\u30011\u7b87\u6240\u5909\u3048\u305f\u3060\u3051\u3067\u7d42\u308f\u308a\u307e\u3059\u3002<\/em><\/strong><br>\u5909\u6570\u306f\u4fbf\u5229\u3067\u3059\u306e\u3067\u3001\u662f\u975e\u4f7f\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2 id=\"i-3\">\u5b9a\u6570<\/h2>\n<p><strong>\u5b9a\u6570\u306f\u5024\u304c\u5909\u3048\u3089\u308c\u306a\u3044\u5024\u3067\u3059\u3002<\/strong><br>\u5909\u6570\u3067\u306f\u5024\u3092\u5f8c\u304b\u3089\u5909\u3048\u3089\u308c\u307e\u3059\u304c\u3001\u5b9a\u6570\u306f\u5909\u3048\u3089\u308c\u307e\u305b\u3093\u3002<br>\u3067\u3059\u304c\u3001Python\u306b\u306f\u5b9a\u6570\u3092\u5b9a\u7fa9\u3059\u308b\u69cb\u6587\u304c\u306a\u3044\u305f\u3081\u3001<strong>\u5b9a\u6570\u7684\u306a\u610f\u56f3\u3092\u6301\u3063\u3066\u5b9a\u7fa9\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u3059\u3079\u3066\u5927\u6587\u5b57\u3067\u5909\u6570\u540d\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u304c\u591a\u3044<\/strong>\u3067\u3059\u3002<br>\u5927\u6587\u5b57\u306e\u5909\u6570\u306b\u51fa\u4f1a\u3063\u305f\u5834\u5408\u306b\u306f\u3001\u5024\u3092\u66f8\u304d\u63db\u3048\u306a\u3044\u3088\u3046\u306b\u3057\u305f\u307b\u3046\u304c\u7121\u96e3\u3067\u3059\u3002<br>Python\u306e\u5b9a\u6570\u306b\u95a2\u3057\u3066\u306f\u3001Python\u306e<a href=\"http:\/\/pep8-ja.readthedocs.io\/ja\/latest\/\" rel=\"nofollow noopener\" target=\"_blank\">\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04PEP8(\u516c\u5f0f)<\/a>\u306a\u3069\u306b\u3082\u8aac\u660e\u3055\u308c\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<h2 id=\"i-4\">\u4e88\u7d04\u8a9e<\/h2>\n<p><strong><em>\u95a2\u6570\u540d\u3084\u5909\u6570\u540d\u306b\u4f7f\u7528\u3067\u304d\u306a\u3044\u5358\u8a9e\u3092\u4e88\u7d04\u8a9e\u3068\u547c\u3073\u307e\u3059\u3002<\/em><\/strong><br>\u4e88\u7d04\u8a9e\u3092\u7528\u3044\u3066\u3057\u307e\u3046\u3068\u3001\u69cb\u6587\u30a8\u30e9\u30fc\uff08SyntaxError)\u304c\u8d77\u3053\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br>Python3\u7cfb\u3067\u306f\u3001\u304a\u304a\u3088\u305d30\u500b\u307b\u3069\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306f\u5168\u3066Python3.6\u7cfb\u3067\u306e\u4e88\u7d04\u8a9e\u3067\u3059\u306e\u3067\u3001\u305d\u308c\u3089\u306f\u5909\u6570\u540d\u306a\u3069\u306b\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p><strong>[\u2018False\u2019, \u2018None\u2019, \u2018True\u2019, \u2018and\u2019, \u2018as\u2019, \u2018assert\u2019, \u2018break\u2019, \u2018class\u2019, \u2018continue\u2019, \u2018def\u2019, \u2018del\u2019, \u2018elif\u2019, \u2018else\u2019, \u2018except\u2019, \u2018finally\u2019, \u2018for\u2019, \u2018from\u2019, \u2018global\u2019, \u2018if\u2019, \u2018import\u2019, \u2018in\u2019, \u2018is\u2019, \u2018lambda\u2019, \u2018nonlocal\u2019, \u2018not\u2019, \u2018or\u2019, \u2018pass\u2019, \u2018raise\u2019, \u2018return\u2019, \u2018try\u2019, \u2018while\u2019, \u2018with\u2019, \u2018yield\u2019]<\/strong><\/p>\n<h2 id=\"i-5\">\u307e\u3068\u3081<\/h2>\n<p>\u3053\u306e\u7ae0\u3067\u306f\u3001Python\u3092\u4f7f\u3063\u3066\u5909\u6570\u3092\u6271\u3046\u65b9\u6cd5\u3092\u5b66\u3073\u307e\u3057\u305f\u3002<br>\u5909\u6570\u306e\u6271\u3044\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u884c\u3046\u4e0a\u3067\u3001\u3068\u3066\u3082\u5927\u4e8b\u306b\u306a\u3063\u3066\u304d\u307e\u3059\u306e\u3067\u3001\u3057\u3063\u304b\u308a\u4f7f\u3044\u3053\u306a\u305b\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><\/p>\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"aiacademy.jp\/bootcamp\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"341\" src=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2021\/12\/bootcamp_ad_72ppi-1024x341.png\" alt=\"\" class=\"wp-image-691\" srcset=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2021\/12\/bootcamp_ad_72ppi-1024x341.png 1024w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2021\/12\/bootcamp_ad_72ppi-300x100.png 300w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2021\/12\/bootcamp_ad_72ppi-768x256.png 768w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2021\/12\/bootcamp_ad_72ppi-940x313.png 940w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2021\/12\/bootcamp_ad_72ppi.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\"><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u6b21 \u5909\u6570 \u5909\u6570\u3092\u4f7f\u308f\u306a\u3044\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u4f7f\u3063\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u6bd4\u8f03 \u5b9a\u6570 \u4e88\u7d04\u8a9e \u307e\u3068\u3081 \u5909\u6570 \u5909\u6570\u3068\u306f\u5024\u306b\u4ed8\u3051\u308b\u540d\u672d\u3067\u3059\u3002\u307e\u305f\u3001\u5909\u6570\u306f\u540d\u524d\u3092\u4ed8\u3051\u3066\u4f7f\u3044\u307e\u3059\u3002\u3053\u306e\u540d\u524d\u3092\u5909\u6570\u540d\u3068\u8a00\u3044\u307e\u3059\u3002\u5024\u306f\u3001\u6570\u5024\u3067\u3082\u6587\u5b57\u5217\u3067\u3082\u5165\u308c\u308b\u3053\u3068\u304c\u51fa\u6765 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":484,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[85,90],"tags":[],"class_list":{"0":"post-121","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python","8":"category-90"},"_links":{"self":[{"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts\/121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=121"}],"version-history":[{"count":9,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts\/121\/revisions"}],"predecessor-version":[{"id":3838,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts\/121\/revisions\/3838"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/media\/484"}],"wp:attachment":[{"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=121"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}