{"id":2523,"date":"2022-03-09T13:02:50","date_gmt":"2022-03-09T04:02:50","guid":{"rendered":"https:\/\/aiacademy.jp\/media\/?p=2523"},"modified":"2024-08-08T15:38:13","modified_gmt":"2024-08-08T06:38:13","slug":"%e3%80%90python%e3%80%91%e5%a4%89%e6%95%b0%e3%81%ae%e3%82%b9%e3%82%b3%e3%83%bc%e3%83%97%e3%82%92%e7%90%86%e8%a7%a3%e3%81%97%e3%82%88%e3%81%86%ef%bc%81%e5%88%9d%e5%ad%a6%e8%80%85%e5%90%91%e3%81%91","status":"publish","type":"post","link":"https:\/\/aiacademy.jp\/media\/?p=2523","title":{"rendered":"\u3010Python\u3011\u5909\u6570\u306e\u30b9\u30b3\u30fc\u30d7\u3092\u7406\u89e3\u3057\u3088\u3046\uff01\u521d\u5b66\u8005\u5411\u3051\u306b\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\uff01"},"content":{"rendered":"<div id=\"sgb-css-id-1\">\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-font-size is-style-fill has-medium-font-size\"><a class=\"wp-block-button__link has-vivid-green-cyan-background-color has-background wp-element-button\" href=\"https:\/\/lin.ee\/3E4GzWk\" rel=\"nofollow noopener\" target=\"_blank\">LINE\u53cb\u3060\u3061\u767b\u9332 \u25b6 Python\u30b3\u30fc\u30b9 \u25b6 \u53d7\u8b1b\u5272\u5f15\u30af\u30fc\u30dd\u30f3 \u7121\u6599\u52d5\u753b<\/a><\/div>\n<\/div>\n<\/div>\n\n\n<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\">    <span><\/span>    <ul class=\"menu_level_1\">      <li class=\"first last\">        <a href=\"#i-0\">\u5909\u6570\u306e\u30b9\u30b3\u30fc\u30d7\u3068\u306f<\/a>      <\/li>    <\/ul>  <\/li>  <li class=\"last\">    <a href=\"#i-1\">Python\u3092\u52b9\u7387\u3088\u304f\u5b66\u3076\u306b\u306f\uff1f<\/a>  <\/li><\/ul>\n      \n    <\/div><\/div><div class=\"toc\"><p><\/p>\n<\/div><h2 class=\"wp-block-heading\" id=\"i-0\">\u5909\u6570\u306e\u30b9\u30b3\u30fc\u30d7\u3068\u306f<\/h2>\n\n\n\n<p>\u5909\u6570\u306e\u30b9\u30b3\u30fc\u30d7\u3068\u306f\u3001\u5909\u6570\u304c\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u7bc4\u56f2\u306e\u3053\u3068\u3067\u3059\u3002\u5909\u6570\u3092\u3069\u3053\u3067\u4f5c\u6210\u3057\u305f\u304b\u306b\u3088\u3063\u3066\u30b9\u30b3\u30fc\u30d7\uff08\u6709\u52b9\u7bc4\u56f2\uff09\u304c\u9055\u3063\u3066\u304d\u307e\u3059\u3002\u5909\u6570\u306e\u5ba3\u8a00\u5834\u6240\u306f\u3001\u5927\u304d\u304f\u300c\u95a2\u6570\u5185\u300d\u3068\u300c\u95a2\u6570\u5916\u300d\u306e2\u901a\u308a\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305a\u306f\u3001\u901a\u5e38\u306e\u95a2\u6570\u306e\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># 1\u3064\u76ee\u306e\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\ndef add(x1):\n    x2 = 10 # \u95a2\u6570\u5185\u3067\u5909\u6570\u3092\u4f5c\u6210(\u30ed\u30fc\u30ab\u30eb\u5909\u6570)\n    result = x1 + x2\n    print(result)\n\nadd(5) # 5 + 10\u306715\u304c\u51fa\u529b<\/code><\/pre>\n\n\n\n<p><strong>\u51fa\u529b\u7d50\u679c<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>15<\/code><\/pre>\n\n\n\n<p><code>add<\/code>\u95a2\u6570\u5185\u306b<code>x2<\/code>\u306f\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u304c\u30017\u884c\u76ee\u306e<code>add<\/code>\u95a2\u6570\u306e\u5f15\u6570\u30675\u3092\u6e21\u3057\u3066\u3044\u308b\u3053\u3068\u304b\u3089\u30012\u884c\u76ee\u306e<code>x1<\/code>\u306b\u5f15\u6570\u3068\u3057\u3066<code>5<\/code>\u3092\u53d7\u3051\u53d6\u308a\u30014\u884c\u76ee\u3067\u8db3\u3057\u7b97\u304c\u6b63\u5e38\u306b\u884c\u308f\u308c\u3066\u3044\u307e\u3059\u3002\u6b21\u306b\u3001\u5909\u6570\u306e\u30b9\u30b3\u30fc\u30d7(\u6709\u52b9\u7bc4\u56f2)\u306b\u95a2\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># 2\u3064\u76ee\u306e\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\ndef add(x1):\n    x2 = 10 # \u95a2\u6570\u5185\u3067\u5909\u6570\u3092\u4f5c\u6210(\u30ed\u30fc\u30ab\u30eb\u5909\u6570)\n    result = x1 + x2\n    print(result)\n\nadd(5) # 5 + 10\u306715\u304c\u51fa\u529b\nprint(x2) # \u3053\u3053\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f<\/code><\/pre>\n\n\n\n<p><strong>\u51fa\u529b\u7d50\u679c<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>NameError: name 'x2' is not defined<\/code><\/pre>\n\n\n\n<p>\u4e0a\u8a18\u306e2\u3064\u76ee\u306e\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001NameError: name \u2018x2\u2019 is not defined\u3068\u3044\u3046\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u304c\u767a\u751f\u3057\u3066\u3057\u307e\u3044\u6b63\u5e38\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u52d5\u4f5c\u3057\u307e\u305b\u3093\u3002<code>NameError<\/code>\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u767a\u751f\u3059\u308b\u7406\u7531\u306f\u3001\u95a2\u6570\u5185\u3067\u5b9a\u7fa9\u3057\u305f\u5909\u6570<code>x2<\/code>\u306f\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u3067\u3042\u308a\u3001\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u306e\u30b9\u30b3\u30fc\u30d7\u306f\u95a2\u6570\u5185\u90e8\u3060\u3051\u3057\u304b\u6709\u52b9\u3067\u306f\u306a\u3044\u305f\u3081\u3001\u95a2\u6570\u306e\u5916\u5074\u3067<code>x2<\/code>\u3092\u547c\u3073\u51fa\u3059\u3068<code>NameError<\/code>\u304c\u767a\u751f\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u6709\u52b9\u306a\u89e3\u6c7a\u624b\u6bb5\u3068\u3057\u3066\u95a2\u6570\u306e\u5916\u306b<code>x2<\/code>\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u95a2\u6570\u306e\u5916\u306b\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3067\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\u3002\u4e0a\u8a18\u306e\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u6539\u5584\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u4e0b\u8a18\u306b\u306a\u308a\u307e\u3059\u3002(\u203b\u5909\u6570\u306e\u30b9\u30b3\u30fc\u30d7\u4ee5\u5916\u306b\u3082\u3001\u95a2\u6570\u5185\u90e8\u51e6\u7406\u306a\u3069\u3082\u4fee\u6b63\u3057\u3066\u3044\u307e\u3059\u3002)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>x2 = 10 # \u95a2\u6570\u306e\u5916\u5074\u3067\u5909\u6570x2\u3092\u4f5c\u6210(\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570)\n\ndef add(x1):\n    # x2 = 10 # \u95a2\u6570\u5185\u3067\u5909\u6570\u3092\u4f5c\u6210(\u30ed\u30fc\u30ab\u30eb\u5909\u6570)\n    result = x1 + x2\n    print(result)\n\nadd(5) # 5 + 10\u306715\u304c\u51fa\u529b\nprint(x2) # 10\u304c\u51fa\u529b<\/code><\/pre>\n\n\n\n<p><strong>\u51fa\u529b\u7d50\u679c<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>15\n10<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"i-1\">Python\u3092\u52b9\u7387\u3088\u304f\u5b66\u3076\u306b\u306f\uff1f<\/h1>\n\n\n\n<p>Python\u3092\u52b9\u7387\u3088\u304f\u5b66\u3076\u306b\u306f\u3001\u666e\u6bb5\u304b\u3089Python\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u73fe\u5f79\u306e\u30c7\u30fc\u30bf\u30b5\u30a4\u30a8\u30f3\u30c6\u30a3\u30b9\u30c8\u3084\u6a5f\u68b0\u5b66\u7fd2\u30a8\u30f3\u30b8\u30cb\u30a2\u306b\u8cea\u554f\u3067\u304d\u308b\u74b0\u5883\u3067\u5b66\u3076\u3053\u3068\u3067\u3059\u3002<br>\u8cea\u554f\u3057\u653e\u984c\u304b\u3064\u3001\u4f53\u7cfb\u7684\u306b\u5b66\u3079\u308b\u52d5\u753b\u30b3\u30f3\u30c6\u30f3\u30c4\u3067\u30c7\u30fc\u30bf\u5206\u6790\u6280\u8853\u3092\u5b66\u3073\u305f\u3044\u65b9\u306f\u3001\u30aa\u30f3\u30e9\u30a4\u30f3\u3067\u597d\u304d\u306a\u6642\u9593\u306b\u52c9\u5f37\u3067\u304d\u308b<a href=\"https:\/\/aiacademy.jp\/bootcamp\">AI Academy Bootcamp<\/a>\u304c\u30aa\u30b9\u30b9\u30e1\u3067\u3059\u3002\u53d7\u8b1b\u6599\u3082\u696d\u754c\u6700\u5b89\u5024\u306e35,000\u5186\uff08\uff16\u30f6\u6708\u9593\u8cea\u554f\u3057\u653e\u984c\uff0b\u30aa\u30ea\u30b8\u30ca\u30eb\u306e\u52d5\u753b\u30b3\u30f3\u30c6\u30f3\u30c4\u3001\u30c6\u30ad\u30b9\u30c8\u30b3\u30f3\u30c6\u30f3\u30c4\u306e\u5229\u7528\u53ef\u80fd\uff09\u306a\u306e\u3067\u3001\u662f\u975e\u3054\u6d3b\u7528\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/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\u306e\u30b9\u30b3\u30fc\u30d7\u3068\u306f Python\u3092\u52b9\u7387\u3088\u304f\u5b66\u3076\u306b\u306f\uff1f \u5909\u6570\u306e\u30b9\u30b3\u30fc\u30d7\u3068\u306f \u5909\u6570\u306e\u30b9\u30b3\u30fc\u30d7\u3068\u306f\u3001\u5909\u6570\u304c\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u7bc4\u56f2\u306e\u3053\u3068\u3067\u3059\u3002\u5909\u6570\u3092\u3069\u3053\u3067\u4f5c\u6210\u3057\u305f\u304b\u306b\u3088\u3063\u3066\u30b9\u30b3\u30fc\u30d7\uff08\u6709\u52b9\u7bc4\u56f2\uff09\u304c\u9055\u3063\u3066\u304d\u307e\u3059\u3002\u5909\u6570\u306e\u5ba3\u8a00\u5834\u6240\u306f\u3001 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":2526,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[85],"tags":[],"class_list":{"0":"post-2523","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python"},"_links":{"self":[{"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts\/2523","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=2523"}],"version-history":[{"count":3,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts\/2523\/revisions"}],"predecessor-version":[{"id":4835,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts\/2523\/revisions\/4835"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/media\/2526"}],"wp:attachment":[{"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2523"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}