{"id":265,"date":"2019-11-18T11:17:01","date_gmt":"2019-11-18T02:17:01","guid":{"rendered":"http:\/\/aiacademy.jp\/media\/?p=265"},"modified":"2025-06-12T16:12:31","modified_gmt":"2025-06-12T07:12:31","slug":"%e3%80%90%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91%e3%80%91%e7%84%a1%e6%96%99%e3%81%a7python%e3%81%ae%e5%9f%ba%e6%9c%ac%e6%96%87%e6%b3%95%e3%82%925%e6%99%82%e9%96%93%e3%81%a7%e5%ad%a6%e3%81%bc","status":"publish","type":"post","link":"https:\/\/aiacademy.jp\/media\/?p=265","title":{"rendered":"\u3010Python\u5165\u9580\u3011\u7121\u6599\u3067Python\u306e\u57fa\u672c\u6587\u6cd5\u30925\u6642\u9593\u3067\u5b66\u307c\u3046\uff01"},"content":{"rendered":"\n<p><span class=\"keiko_green\">\u3053\u306e\u30b5\u30a4\u30c8\u306f\u3001Python\u3084\u751f\u6210AI\u306a\u3069\u3092\u5b66\u3079\u308b\u30aa\u30f3\u30e9\u30a4\u30f3\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb AI Academy Bootcamp\u304c\u904b\u55b6\u3057\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n\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\">        <a href=\"#i-0\">\u306f\u3058\u3081\u306b<\/a>      <\/li>      <li>        <a href=\"#i-1\">\u306a\u305cPython\u306a\u306e\u304b\uff1f<\/a>      <\/li>      <li>        <a href=\"#i-2\">Python\u74b0\u5883\u69cb\u7bc9<\/a>      <\/li>      <li>        <a href=\"#i-3\">\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e Python\u3068\u306f<\/a>      <\/li>      <li>        <a href=\"#i-4\">Python\u3067\u51fa\u6765\u308b\u3053\u3068<\/a>      <\/li>      <li>        <a href=\"#i-5\">Python2\u7cfb\u30683\u7cfb\u306e\u9055\u3044<\/a>      <\/li>      <li>        <a href=\"#i-6\">\u00a0<\/a>      <\/li>      <li>        <a href=\"#i-7\">\u3010\u7121\u6599\u52d5\u753b\uff1a\u500d\u901f\u3067\u5b66\u3076\uff01\u751f\u6210AI\u3092\u6d3b\u7528\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u52c9\u5f37\u6cd5\uff08\u77ed\u7e2e\u7248\uff09\u3011<\/a>      <\/li>      <li>        <a href=\"#i-8\">PEP8<\/a>      <\/li>      <li>        <a href=\"#i-9\">\u6587\u5b57\u5217\u3068\u306f<\/a>      <\/li>      <li>        <a href=\"#i-10\">\u30b3\u30e1\u30f3\u30c8<\/a>      <\/li>      <li>        <a href=\"#i-11\">\u6570\u5024<\/a>      <\/li>      <li>        <a href=\"#i-12\">\u6587\u5b57\u5217\u3068\u6570\u5024\u306e\u9055\u3044<\/a>      <\/li>      <li>        <a href=\"#i-13\">\u6587\u5b57\u5217\u306e\u9023\u7d50<\/a>      <\/li>      <li>        <a href=\"#i-14\">\u5909\u6570<\/a>      <\/li>      <li>        <a href=\"#i-15\">\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-16\">\u5b9a\u6570<\/a>      <\/li>      <li>        <a href=\"#i-17\">\u4e88\u7d04\u8a9e<\/a>      <\/li>      <li>        <a href=\"#i-18\">\u5168\u4f53\u50cf<\/a>      <\/li>      <li>        <a href=\"#i-19\">\u5909\u6570\u3068\u578b<\/a>      <\/li>      <li>        <a href=\"#i-20\">\u30c7\u30fc\u30bf\u578b<\/a>      <\/li>      <li>        <a href=\"#i-21\">\u6570\u5b57\uff08\u6570\u5024\u578b\uff09<\/a>      <\/li>      <li>        <a href=\"#i-22\">\u6587\u5b57\u5217\u578b<\/a>      <\/li>      <li>        <a href=\"#i-23\">\u578b\u5909\u63db(\u30ad\u30e3\u30b9\u30c8)<\/a>      <\/li>      <li>        <a href=\"#i-24\">\u30ea\u30b9\u30c8\u578b<\/a>      <\/li>      <li>        <a href=\"#i-25\">\u30ea\u30b9\u30c8\u306e\u8ffd\u52a0<\/a>      <\/li>      <li>        <a href=\"#i-26\">\u8f9e\u66f8\u578b<\/a>      <\/li>      <li>        <a href=\"#i-27\">\u30ea\u30b9\u30c8\u578b\u3068\u8f9e\u66f8\u578b\u306e\u9055\u3044<\/a>      <\/li>      <li>        <a href=\"#i-28\">\u30ea\u30b9\u30c8\u578b\u3068\u8f9e\u66f8\u578b\u306e\u5171\u901a\u3059\u308b\u3068\u3053\u308d<\/a>      <\/li>      <li>        <a href=\"#i-29\">\u5236\u5fa1\u69cb\u9020<\/a>      <\/li>      <li>        <a href=\"#i-30\">\u30d7\u30ed\u30b0\u30e9\u30e0\u51e6\u7406\u306e\u6d41\u308c<\/a>      <\/li>      <li>        <a href=\"#i-31\">\u30b3\u30fc\u30c9\u30d6\u30ed\u30c3\u30af\u3068\u30a4\u30f3\u30c7\u30f3\u30c8<\/a>      <\/li>      <li>        <a href=\"#i-32\">\u6761\u4ef6\u5206\u5c90 (if\u6587)<\/a>      <\/li>      <li>        <a href=\"#i-33\">\u6761\u4ef6\u5f0f\u306e\u4f5c\u308a\u65b9<\/a>      <\/li>      <li>        <a href=\"#i-34\">\u30eb\u30fc\u30d7<\/a>      <\/li>      <li>        <a href=\"#i-35\">for\u6587<\/a>      <\/li>      <li>        <a href=\"#i-36\">\u8f9e\u66f8\u578b\u306e\u30c7\u30fc\u30bf\u3092\u30eb\u30fc\u30d7\u3059\u308b<\/a>      <\/li>      <li>        <a href=\"#i-37\">while\u6587<\/a>      <\/li>      <li>        <a href=\"#i-38\">\u7121\u9650\u30eb\u30fc\u30d7<\/a>      <\/li>      <li>        <a href=\"#i-39\">\u30ea\u30b9\u30c8\u5185\u5305\u8868\u8a18<\/a>      <\/li>      <li>        <a href=\"#i-40\">\u305d\u306e\u4ed6\u5185\u5305\u8868\u8a18<\/a>      <\/li>      <li>        <a href=\"#i-41\">\u6a19\u6e96\u5165\u529b<\/a>      <\/li>      <li>        <a href=\"#i-42\">\u95a2\u6570\u3068\u306f<\/a>      <\/li>      <li>        <a href=\"#i-43\">\u95a2\u6570\u3092\u4f7f\u3046\u30e1\u30ea\u30c3\u30c8\u30fb\u30c7\u30e1\u30ea\u30c3\u30c8<\/a>      <\/li>      <li>        <a href=\"#i-44\">\u95a2\u6570\u306e\u5b9a\u7fa9<\/a>      <\/li>      <li>        <a href=\"#i-45\">\u95a2\u6570\u540d<\/a>      <\/li>      <li>        <a href=\"#i-46\">pass<\/a>      <\/li>      <li>        <a href=\"#i-47\">\u5f15\u6570<\/a>      <\/li>      <li>        <a href=\"#i-48\">\u8fd4\u308a\u5024(\u623b\u308a\u5024)<\/a>      <\/li>      <li>        <a href=\"#i-49\">\u5f15\u6570\u3068return<\/a>      <\/li>      <li>        <a href=\"#i-50\">\u306a\u305creturn\u3092\u4f7f\u3046\u306e\u304b<\/a>      <\/li>      <li>        <a href=\"#i-51\">return\u3092\u5229\u7528\u3057\u305f\u95a2\u6570\u306e\u30b5\u30f3\u30d7\u30eb<\/a>      <\/li>      <li>        <a href=\"#i-52\">\u5f15\u6570\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u5024<\/a>      <\/li>      <li>        <a href=\"#i-53\">\u95a2\u6570 \u5909\u6570\u306e\u30b9\u30b3\u30fc\u30d7<\/a>      <\/li>      <li>        <a href=\"#i-54\">\u30b0\u30ed\u30fc\u30d0\u30eb(global)\u5ba3\u8a00\u30fb\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570<\/a>      <\/li>      <li>        <a href=\"#i-56\">\u30e9\u30a4\u30d6\u30e9\u30ea<\/a>      <\/li>      <li>        <a href=\"#i-57\">\u30e2\u30b8\u30e5\u30fc\u30eb\u3068\u30d1\u30c3\u30b1\u30fc\u30b8<\/a>      <\/li>      <li>        <a href=\"#i-58\">\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30dd\u30fc\u30c8<\/a>      <\/li>      <li>        <a href=\"#i-59\">\u72ec\u81ea\u3067\u4f5c\u6210\u3057\u305f\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b<\/a>      <\/li>      <li>        <a href=\"#i-60\">from\u3068import<\/a>      <\/li>      <li>        <a href=\"#i-61\">\u5225\u540d\u3067\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30dd\u30fc\u30c8<\/a>      <\/li>      <li>        <a href=\"#i-62\">\u5fc5\u8981\u306a\u3082\u306e\u3060\u3051\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b<\/a>      <\/li>      <li>        <a href=\"#i-63\">\u30e9\u30a4\u30d6\u30e9\u30ea\u30fb\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5834\u6240\u3092\u8abf\u3079\u308b<\/a>      <\/li>      <li>        <a href=\"#i-64\">\u304a\u307f\u304f\u3058\u30a2\u30d7\u30ea\u3092\u5b9f\u884c\u3057\u3066\u307f\u308b\u3002<\/a>      <\/li>      <li>        <a href=\"#i-65\">\u306f\u3058\u3081\u306b<\/a>      <\/li>      <li>        <a href=\"#i-66\">\u91cd\u8981\u306a\u7528\u8a9e<\/a>      <\/li>      <li>        <a href=\"#i-67\">\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411<\/a>      <\/li>      <li>        <a href=\"#i-68\">\u30af\u30e9\u30b9<\/a>      <\/li>      <li>        <a href=\"#i-69\">\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/a>      <\/li>      <li>        <a href=\"#i-70\">\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf<\/a>      <\/li>      <li>        <a href=\"#i-71\">\u30e1\u30bd\u30c3\u30c9<\/a>      <\/li>      <li>        <a href=\"#i-72\">\u7d99\u627f<\/a>      <\/li>      <li>        <a href=\"#i-73\">\u591a\u91cd\u7d99\u627f<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-74\">\u30e1\u30bd\u30c3\u30c9\u306e\u30aa\u30fc\u30d0\u30e9\u30a4\u30c9<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-75\">\u307e\u3068\u3081<\/a>  <\/li>  <li class=\"last\">    <a href=\"#i-76\">\u3082\u3063\u3068Python\u3092\u5b66\u3073\u305f\u3044\u65b9\u3078<\/a>  <\/li><\/ul>\n      \n    <\/div><\/div><div class=\"toc\"><p><\/p>\n<\/div><h2 class=\"wp-block-heading\" id=\"i-0\">\u306f\u3058\u3081\u306b<\/h2>\n\n\n\n<p>\u3053\u306e\u8a18\u4e8b\u306f\u3001AI Academy\u306ePython<a href=\"https:\/\/aiacademy.jp\/texts\/#grammar\" target=\"_blank\" rel=\"noopener\">\u6587\u6cd5\u901f\u7fd2\u7de8<\/a>\u3068<a href=\"https:\/\/aiacademy.jp\/texts\/#python\" target=\"_blank\" rel=\"noopener\">Python \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5165\u9580\u7de8<\/a>\u306e\u5185\u5bb9\u3092\u30d9\u30fc\u30b9\u306b\u4e00\u90e8\u4fee\u6b63\u3092\u52a0\u3048\u305f\u3082\u306e\u3067\u3059\u3002<br>\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u307f\u9032\u3081\u308b\u3053\u3068\u3067\u3001Python\u306e\u57fa\u672c\u6587\u6cd5\u306e\u57fa\u790e\u3092\u5b66\u3076\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<br>Python\u3092\u5b66\u3073\u7d42\u308f\u3063\u305f\u65b9\u306f\u3001\u7121\u6599\uff08\u4e00\u90e8\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u306e\u307f\u6709\u6599\u3060\u304c\u57fa\u790e\u30b3\u30f3\u30c6\u30f3\u30c4\u306f\u307b\u307c\u5168\u3066\u7121\u6599\uff09\u3067AI\u30fb\u6a5f\u68b0\u5b66\u7fd2\u304c\u5b66\u3079\u308b<a href=\"https:\/\/aiacademy.jp\/texts\/\" target=\"_blank\" rel=\"noopener\">AI Academy<\/a>\u3082\u6d3b\u7528\u304f\u3060\u3055\u3044\u3002<br>\u203b\u500b\u4eba\u5411\u3051\u77ed\u671fAI\u30d6\u30fc\u30c8\u30ad\u30e3\u30f3\u30d7\u306f<a href=\"https:\/\/aiacademy.jp\/bootcamp\/\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-1\">\u306a\u305cPython\u306a\u306e\u304b\uff1f<\/h2>\n\n\n\n<p><strong><a href=\"https:\/\/aiacademy.jp\/\" target=\"_blank\" rel=\"noopener\">AI Academy<\/a>\u3067\u306f\u4eba\u5de5\u77e5\u80fd\uff08AI\uff09\u5206\u91ce\u3092\u4e2d\u5fc3\u3068\u3057\u305f\u5b66\u7fd2\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u6271\u3063\u3066\u304a\u308a\u3001\u305d\u306e\u4eba\u5de5\u77e5\u80fd\u5206\u91ce\u306b\u304a\u3044\u3066Python\u306f\u6a5f\u68b0\u5b66\u7fd2\u30fb\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u3092\u5bb9\u6613\u306b\u6271\u3046\u3053\u3068\u304c\u3067\u304d\u308b\u304b\u3089\u3067\u3059\u3002<\/strong><br>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306e\u4eba\u6c17\u30e9\u30f3\u30ad\u30f3\u30b0\u300cTIOBE Index\u300d\u3092\u6bce\u6708\u767a\u8868\u3057\u3066\u3044\u308b<a href=\"https:\/\/www.tiobe.com\/tiobe-index\/\" target=\"_blank\" rel=\"noopener nofollow\">TIOBE Software<\/a> \u3067\u3082Python\u306f\u30c8\u30c3\u30d7\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/image.itmedia.co.jp\/ait\/articles\/2410\/10\/aitms_tiobe10_02.png\" alt=\"\"><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>TIOBE\u30a4\u30f3\u30c7\u30c3\u30af\u30b91\uff5e10\u4f4d\u306e\u63a8\u79fb\uff08\u63d0\u4f9b\uff1aTIOBE Software\uff09<\/p>\n\n\n\n<p><strong>Python\u306f\u4eba\u5de5\u77e5\u80fd\u6280\u8853\u4ee5\u5916\u306b\u3082\u3001Web\u958b\u767a\u3084\u4fbf\u5229\u306a\u696d\u52d9\u81ea\u52d5\u5316\u30c4\u30fc\u30eb\u306a\u3069\u5e45\u5e83\u304f\u958b\u767a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001Python\u3092\u7fd2\u5f97\u3059\u308b\u3053\u3068\u3067\u5e45\u5e83\u3044\u3053\u3068\u30921\u3064\u306e\u8a00\u8a9e\u3067\u51fa\u6765\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/strong><br>\u3055\u3089\u306b\u3001<strong>Python\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u81ea\u4f53\u304c\u3001\u30b7\u30f3\u30d7\u30eb\u3067\u53ef\u8aad\u6027\u3082\u9ad8\u304f\u3001\u7fd2\u5f97\u3057\u3084\u3059\u3044\u3053\u3068<\/strong>\u304b\u3089\u5927\u5909\u30aa\u30b9\u30b9\u30e1\u3067\u3059\u3002<br>\u662f\u975e\u3068\u3082AI Academy\u3067Python\u306e\u57fa\u672c\u6587\u6cd5\u304b\u3089\u59cb\u307e\u308a\u3001Web\u958b\u767a\u3084\u6a5f\u68b0\u5b66\u7fd2\u307e\u3067\u7fd2\u5f97\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff01<br>\u203b\u3053\u306e\u30c6\u30ad\u30b9\u30c8\u3067\u306f\u3001Python\u306e\u6587\u6cd5\u306e\u5fc5\u8981\u6700\u4f4e\u9650\u306a\u5185\u5bb9\u306e\u307f\u3092\u8aac\u660e\u3057\u3066\u3044\u307e\u3059\u3002<br>Python\u306e\u3088\u308a\u8a73\u7d30\u306a\u6587\u6cd5\u3092\u5b66\u3073\u305f\u3044\u65b9\u306f\u3001<a href=\"https:\/\/aiacademy.jp\/texts\/#python\" target=\"_blank\" rel=\"noopener\">AI Academy Python\u6587\u6cd5\u7de8<\/a>\u3092\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-2\">Python\u74b0\u5883\u69cb\u7bc9<\/h2>\n\n\n\n<p>\u3053\u306e\u7ae0\u3067\u306fPython\u306e\u57fa\u672c\u6587\u6cd5\u306e\u901f\u7fd2\u306e\u89e3\u8aac\u306b\u91cd\u304d\u3092\u304a\u304d\u307e\u3059\u3002<br>\u624b\u3063\u53d6\u308a\u65e9\u304f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304d\u305f\u3044\u5834\u5408\u306f\u3001\u30d6\u30e9\u30a6\u30b6\u3067Python\u306e\u74b0\u5883\u69cb\u7bc9\u306a\u3057\u306b\u3001Python\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u304c\u3067\u304d\u308b<a href=\"https:\/\/colab.research.google.com\/\" target=\"_blank\" rel=\"noopener nofollow\">Google Colaboratory<\/a>\u3092\u5229\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/colab.research.google.com\/\" target=\"_blank\" rel=\"noopener nofollow\">Google Colaboratory<\/a>\u3092\u4f7f\u3046\u5834\u5408\u306f\u74b0\u5883\u69cb\u7bc9\u306f\u4e0d\u8981\u3067\u3059\u3002<br>\u307e\u305f\u3001\u3053\u306e\u30c6\u30ad\u30b9\u30c8\u3067\u306fPython3\u7cfb\u3092\u6271\u3044\u307e\u3059\u3002<br>\u624b\u5143\u306ePC\u306bPython\u304c\u52d5\u304f\u74b0\u5883\u3092\u4f5c\u308b\u5834\u5408\u306f\u3001<a href=\"?id=2\" target=\"_blank\" rel=\"noopener\">Python \u74b0\u5883\u69cb\u7bc9<\/a>\u30c6\u30ad\u30b9\u30c8\u3092\u8aad\u307f\u9032\u3081\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-3\">\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e Python\u3068\u306f<\/h2>\n\n\n\n<p>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e Python\u3068\u306f\u30011991\u5e74\u306b\u30aa\u30e9\u30f3\u30c0\u4eba\u306e\u30b0\u30a4\u30c9\u30fb\u30f4\u30a1\u30f3\u30fb\u30ed\u30c3\u30b5\u30e0\u6c0f\u306b\u3088\u3063\u3066\u958b\u767a\u3055\u308c\u305f<strong>\u6c4e\u7528\u7684\u306a\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e<\/strong>\u3067\u3059\u3002<br><strong><em>Python\u306e\u826f\u3055\u3068\u3057\u3066\u3001\u5c11\u306a\u3044\u30b3\u30fc\u30c9\u3067\u30b7\u30f3\u30d7\u30eb\u306b\u8a18\u8ff0\u3067\u304d\u308b\u3053\u3068\u304c\u6319\u3052\u3089\u308c\u307e\u3059\u3002<\/em><\/strong><br>Python\u3067\u306f\u3001Google\u3084DropBox\u306a\u3069\u4e16\u754c\u7684\u306b\u4f7f\u308f\u308c\u3066\u3044\u308b\u8a00\u8a9e\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-4\">Python\u3067\u51fa\u6765\u308b\u3053\u3068<\/h2>\n\n\n\n<p>\u3056\u3063\u3068\u5927\u304d\u304f\u3042\u3052\u308b\u3068\u4ee5\u4e0b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u4eba\u5de5\u77e5\u80fd\u95a2\u9023\uff08\u753b\u50cf\u8a8d\u8b58\u30fb\u81ea\u7136\u8a00\u8a9e\u51e6\u7406\u30fb\u97f3\u58f0\u8a8d\u8b58 etc..)<\/li>\n\n\n\n<li>\u6a5f\u68b0\u5b66\u7fd2\u30fb\u7d71\u8a08\u89e3\u6790<\/li>\n\n\n\n<li>Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fbWeb\u30b5\u30fc\u30d3\u30b9\u958b\u767a<\/li>\n\n\n\n<li>\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u30a2\u30d7\u30ea\u5236\u4f5c(tkinter\u306a\u3069)<\/li>\n\n\n\n<li>\u696d\u52d9\u52b9\u7387\u5316\u30d7\u30ed\u30b0\u30e9\u30e0<\/li>\n\n\n\n<li>Web\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0<\/li>\n\n\n\n<li>IoT<\/li>\n\n\n\n<li>\u30ed\u30dc\u30c3\u30c8\u5236\u5fa1<\/li>\n\n\n\n<li>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30fb\u30b5\u30a4\u30d0\u30fc\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0<\/li>\n\n\n\n<li>\u30b2\u30fc\u30e0\u958b\u767a<\/li>\n<\/ol>\n\n\n\n<p>\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u30a2\u30d7\u30ea\u306a\u3069\u306f\u3001\u3042\u307e\u308aPython\u306f\u5411\u3044\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u8a18\u8f09\u3057\u3066\u304a\u308a\u307e\u305b\u3093\u3002<br>\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u30a2\u30d7\u30ea(iOS\u3084Android\u30a2\u30d7\u30ea)\u958b\u767a\u3092\u3055\u308c\u308b\u5834\u5408\u306f\u3001iOS\u30a2\u30d7\u30ea\u3067\u3059\u3068Swift(iOS)\u3001<br>Android\u30a2\u30d7\u30ea\u3067\u3059\u3068Java\u3084Kotlin(\u30b3\u30c8\u30ea\u30f3)\u3092\u5b66\u3076\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br>3D\u3084AR\u30fbVR\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5834\u5408\u306f\u3001Unity(C#\u306a\u3069)\u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br>\u8fd1\u5e74\u3067\u306f\u3001React Native\u3068\u3044\u3046Facebook\u304c\u958b\u767a\u3057\u305f\u30e2\u30d0\u30a4\u30eb\u30a2\u30d7\u30ea\u5411\u3051\u306eJavaScript\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306a\u3069\u3082\u3042\u308a\u307e\u3059\u3002<br>\u4e0a\u8a18\u306e\u5185\u5bb9\u304c\u6c17\u306b\u306a\u3063\u305f\u65b9\u306f\u662f\u975e\u3001\u3054\u81ea\u8eab\u3067\u8abf\u3079\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br>\uff08\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u884c\u3046\u4e0a\u3067\u306f\u8abf\u3079\u308b\u30b9\u30ad\u30eb\u306f\u3068\u3066\u3082\u5f79\u306b\u7acb\u3061\u307e\u3059\u3002\uff09<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-5\">Python2\u7cfb\u30683\u7cfb\u306e\u9055\u3044<\/h2>\n\n\n\n<p>\u5909\u66f4\u70b9\u306f\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u304c\u3001print\u6587\u304cprint()\u95a2\u6570\u306b\u5909\u66f4\u3055\u308c\u305f\u3053\u3068\u3084\u3001long\u578b\u304c\u5ec3\u6b62\u3055\u308cint\u578b\u3068\u3057\u3066\u6271\u308f\u308c\u305f\u308a\u306a\u3069\u3042\u308a\u307e\u3059\u3002<br>AI Academy\u306e\u30c6\u30ad\u30b9\u30c8\u3067\u306f\u3001\u3053\u308c\u304b\u3089\u4e3b\u6d41\u306b\u306a\u308bPython3\u7cfb\u3092\u6271\u3063\u3066\u3044\u304f\u305f\u3081\u30012\u7cfb\u306e\u77e5\u8b58\u306f\u5fc5\u9808\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001Python2\u7cfb\u30683\u7cfb\u306e\u9055\u3044\u304c\u6c17\u306b\u306a\u308b\u65b9\u306f\u4e0b\u8a18\u8a18\u4e8b\u3092\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br><a href=\"http:\/\/qiita.com\/CS_Toku\/items\/353fd4b0fd9ed17dc152\" target=\"_blank\" rel=\"noopener nofollow\">\u53c2\u8003\u8a18\u4e8b1<\/a><br><a href=\"http:\/\/diveintopython3-ja.rdy.jp\/porting-code-to-python-3-with-2to3.html\" target=\"_blank\" rel=\"noopener nofollow\">\u53c2\u8003\u8a18\u4e8b2<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-6\">&nbsp;<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-7\">\u3010\u7121\u6599\u52d5\u753b\uff1a<strong>\u500d\u901f\u3067\u5b66\u3076\uff01\u751f\u6210AI\u3092\u6d3b\u7528\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u52c9\u5f37\u6cd5\uff08\u77ed\u7e2e\u7248\uff09\u3011<\/strong><\/h2>\n\n\n\n<p>\u751f\u6210AI\u3092\u6d3b\u7528\u3057\u3066\u52b9\u7387\u7684\u306b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u5b66\u3076\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002\u751f\u6210AI\u306e\u57fa\u672c\u7684\u306a\u4ed5\u7d44\u307f\u3084\u52b9\u679c\u7684\u306a\u6d3b\u7528\u6cd5\u3001\u6ce8\u610f\u70b9\u306b\u3064\u3044\u3066\u3082\u8a73\u3057\u304f\u8aac\u660e\u3002\u52c9\u5f37\u6cd5\u3068\u3068\u3082\u306b\u751f\u6210AI\u305d\u306e\u3082\u306e\u306b\u3064\u3044\u3066\u3082\u5b66\u3079\u308b\u5185\u5bb9\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u305c\u3072\u3054\u89a7\u304f\u3060\u3055\u3044\uff01\u3000<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-vimeo wp-block-embed-vimeo wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" src=\"https:\/\/player.vimeo.com\/video\/1069835048?h=e43b17d6de&amp;dnt=1&amp;app_id=122963\" width=\"880\" height=\"495\" frameborder=\"0\" allow=\"autoplay; fullscreen; picture-in-picture; clipboard-write; encrypted-media; web-share\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><strong>\u5168\u7de8\u306f\u3001AI Academy\u516c\u5f0fLINE\u3067\u914d\u4fe1\u4e2d\u3067\u3059\u3002<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a href=\"https:\/\/lin.ee\/3E4GzWk\" rel=\"nofollow noopener\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"517\" src=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/LINE_Buttom.png\" alt=\"\" class=\"wp-image-6799\" style=\"width:158px;height:auto\" srcset=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/LINE_Buttom.png 910w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/LINE_Buttom-300x170.png 300w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/LINE_Buttom-768x436.png 768w\" sizes=\"auto, (max-width: 910px) 100vw, 910px\"><\/a><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-8\">PEP8<\/h2>\n\n\n\n<p>PEP8\u306f\u3001Python \u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u306b\u306a\u308a\u307e\u3059\u3002<br>Python\u3067\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u59cb\u3081\u308b\u306b\u3042\u305f\u3063\u3066\u3001\u305d\u306e\u90fd\u5ea6\u76ee\u3092\u901a\u3057\u3066\u9802\u3051\u305f\u3089\u3068\u601d\u3044\u307e\u3059\u3002<br><a href=\"https:\/\/pep8-ja.readthedocs.io\/ja\/latest\/\" target=\"_blank\" rel=\"noopener nofollow\">PEP8<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-9\">\u6587\u5b57\u5217\u3068\u306f<\/h2>\n\n\n\n<p>\u6587\u5b57\u5217\u306f\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u300c\u201d\u300d\u307e\u305f\u306f\u3001\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u300c\u2019\u300d\u3067\u56f2\u307e\u308c\u305f\u6587\u5b57\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u4e16\u754c\u3067\u300c\u6587\u5b57\u5217\u300d\u3068\u547c\u3073\u307e\u3059\u3002<br><strong><em>\u6587\u5b57\u5217\u306f\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u300c\u2019\u300d\u3001\u307e\u305f\u306f\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u300c\u201d\u300d\u3067\u56f2\u3080\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/em><\/strong><br>Python3\u3067\u306f\u3069\u3061\u3089\u3067\u56f2\u3093\u3067\u3082\u51fa\u529b\u7d50\u679c\u306f\u540c\u3058\u3067\u3059\u3002<br>\u307e\u305f\u3001\u6587\u5b57\u5217\u3092\u51fa\u529b\u3059\u308b\u969b\u306b\u3001\u300c\u2019\u300d\u3001\u300c\u201d\u300d\u3067\u56f2\u3093\u3067\u3044\u306a\u3044\u5834\u5408\u3001\u30b3\u30fc\u30c9\u304c\u52d5\u304b\u306a\u304f\u306a\u308a\u307e\u3059\u3002<br>\u4f59\u529b\u304c\u3042\u308b\u65b9\u306f\u3001\u30a8\u30e9\u30fc(SyntaxErrror)\u3092\u51fa\u3057\u3066\u3001\u30b3\u30fc\u30c9\u304c\u52d5\u304b\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br>\u3053\u3053\u3067\u306f\u3001\u300c\u2019\u300d\u3084\u300c\u201d\u300d\u3067\u56f2\u307e\u306a\u3044\u5834\u5408\u306b\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3001\u52d5\u304b\u306a\u3044\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u3044\u305f\u3060\u3051\u308c\u3070\u3088\u308a\u7406\u89e3\u51fa\u6765\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30fb<a href=\"http:\/\/d.hatena.ne.jp\/climpy\/20090913\/1252806499\" target=\"_blank\" rel=\"noopener nofollow\">\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u300c\u2019\u300d\u3001\u307e\u305f\u306f\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u300c\u201d\u300d\u306e\u9055\u3044\u3001\u4f7f\u3044\u5206\u3051<\/a><br>\u30fb<a href=\"http:\/\/nonbiri-tereka.hatenablog.com\/entry\/2014\/06\/02\/083206\" target=\"_blank\" rel=\"noopener nofollow\">\u30a8\u30e9\u30fc\u30b3\u30fc\u30c9\uff08\u4f8b\u3048\u3070\u3001SyntaxError)\u306e\u7a2e\u985e\u306b\u3064\u3044\u3066<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-10\">\u30b3\u30e1\u30f3\u30c8<\/h2>\n\n\n\n<p>\u30b3\u30fc\u30c9\u306e\u4e2d\u306b\u306f\u30b3\u30e1\u30f3\u30c8\u3092\u66f8\u304f\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<br>\u884c\u982d\u306b\u300c#\u300d\u3082\u3057\u304f\u306f\u3001\u300c\u201d\u201d\u201d \u201c\u201d\u201d\u300d\u3092\u66f8\u304f\u3053\u3068\u3067\u884c\u672b\u307e\u3067\u30b3\u30e1\u30f3\u30c8\u3068\u307f\u306a\u3055\u308c\u307e\u3059\u3002<br><strong><em>\u30b3\u30e1\u30f3\u30c8\u3092\u66f8\u304f\u3053\u3068\u3067\u3001\u30b3\u30fc\u30c9\u304c\u5b9f\u884c\u3055\u308c\u308b\u6642\u306b\u5168\u3066\u7121\u8996\u3055\u308c\u308b\u306e\u3067\u3001\u30b3\u30fc\u30c9\u306b\u95a2\u3059\u308b\u30e1\u30e2\u306a\u3069\u3068\u3057\u3066\u4f7f\u3046\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/em><\/strong><br>\u696d\u52d9\u3067\u306f\u3001\u8907\u6570\u4eba\u3067\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308b\u3053\u3068\u304c\u307b\u3068\u3093\u3069\u3067\u3059\u3002<br>\u305d\u306e\u305f\u3081\u3001<strong><em>\u5e38\u65e5\u9803\u304b\u3089\u4ed6\u4eba\u304c\u30b3\u30fc\u30c9\u3092\u8aad\u3080\u3068\u304d\u306b\u8aad\u307f\u3084\u3059\u3044\u3088\u3046\u306b\u30b3\u30e1\u30f3\u30c8\u3092\u6b8b\u3057\u3066\u304a\u304f\u3053\u3068\u306f\u5927\u4e8b\u3067\u3059\u3002<\/em><\/strong><br>\u306a\u308b\u3079\u304f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u5185\u306b\u306f\u4ed6\u4eba\u304c\u8aad\u307f\u3084\u3059\u3044\u3088\u3046\u306b\u3001\u30b3\u30e1\u30f3\u30c8\u3092\u66f8\u304f\u7fd2\u6163\u3092\u3064\u3051\u308b\u3053\u3068\u3092\u30aa\u30b9\u30b9\u30e1\u81f4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u3053\u306e\u884c\u306f\u30b3\u30e1\u30f3\u30c8\u3067\u3059\u3002\u3053\u306e\u884c\u306f\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3002\n\nprint(\"Hello, Python\") \n\n\"\"\"\n\u3053\u306e\u884c\u306f\u8907\u6570\u884c\u30b3\u30e1\u30f3\u30c8\u3067\u3059\u3002\u3053\u306e\u884c\u306f\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3002\n\u3053\u306e\u884c\u306f\u8907\u6570\u884c\u30b3\u30e1\u30f3\u30c8\u3067\u3059\u3002\u3053\u306e\u884c\u306f\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3002\n\"\"\"\n<\/code><\/pre>\n\n\n\n<p>\u307e\u305f\u3001\u4f59\u529b\u304c\u3042\u308b\u65b9\u306f\u4e0a\u8a18\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3057\u3001\u30b3\u30e1\u30f3\u30c8\u3057\u305f\u8a18\u8ff0\u304c\u8868\u793a\u3055\u308c\u306a\u3044\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-11\">\u6570\u5024<\/h2>\n\n\n\n<p>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3067\u306f\u3001\u300c\u6570\u5024\u300d\u3092\u6271\u3046\u3053\u3068\u3082\u51fa\u6765\u307e\u3059\u3002<br>\u6587\u5b57\u5217\u3068\u9055\u3044\u3001\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u56f2\u3080\u5fc5\u8981\u304c\u3042\u308a\u307e\u305b\u3093\u3002<br><strong><em>\u6570\u5b57\u3092\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u53ca\u3073\u3001\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u56f2\u3080\u3068\u6587\u5b57\u5217\u306b\u306a\u308b\u306e\u3067\u6ce8\u610f\u3067\u3059\u3002<\/em><\/strong><br>\u8a73\u3057\u304f\u306f\u6b21\u7ae0\u3001\u300c\u5909\u6570\u3068\u30c7\u30fc\u30bf\u578b\u300d\u3067\u8a73\u3057\u304f\u8aac\u660e\u81f4\u3057\u307e\u3059\u3002<br>\u307e\u305f\u3001\u300c+\u300d\u3001\u300c-\u300d\u3001\u300c\/\u300d\u3001\u300c%\u300d\u3068\u884c\u3063\u305f\u8a18\u53f7\u3092\u4f7f\u3046\u3053\u3068\u3067\u56db\u5247\u6f14\u7b97\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br>\u56db\u5247\u6f14\u7b97\u304c\u51fa\u6765\u308b\u3068\u3044\u3046\u3053\u3068\u306f\u3001\u96fb\u5353\u3068\u540c\u69d8\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>print(10) # \u6570\u5024\u306f\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u56f2\u3080\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002\nprint(10 + 5) # \u8db3\u3057\u3066\u3044\u308b\nprint(5 - 2)  # \u5f15\u3044\u3066\u3044\u308b\nprint(10 \/ 2)   # \u5272\u3063\u3066\u3044\u308b\nprint(10 % 5)   # \u3042\u307e\u308a\u3092\u6c42\u3081\u3066\u3044\u308b\n\n# \u512a\u5148\u9806\u4f4d\u306e\u5909\u66f4\n# \u901a\u5e38\u306f +\u3068-\u3088\u308a\u3082*\u3084\/\u306e\u65b9\u304c\u512a\u5148\u5ea6\u304c\u9ad8\u3044\u3067\u3059\u304c\u3001()\u3067\u56f2\u3080\u3053\u3068\u3067\u512a\u5148\u5ea6\u3092\u5909\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\nprint((20 - 5) \/\/ 3)  # 5 \n\n<\/code><\/pre>\n\n\n\n<p>\u3067\u306f\u3001\u4e0a\u8a18\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br>\u4e0a\u304b\u3089\u9806\u306b\u3001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>10\n15\n3\n5.0\n0\n<\/code><\/pre>\n\n\n\n<p>\u304c\u51fa\u529b\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u51fa\u6765\u308c\u3070\u5927\u4e08\u592b\u3067\u3059\u3002<br>\u6b21\u306b\u3001\u5272\u7b97\u306e\u51fa\u529b\u7d50\u679c\u304c\u5c0f\u6570\u70b9\u3068\u3044\u3046\u70b9\u306b\u95a2\u3057\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<br>Python2\u7cfb\u3067\u3042\u308c\u3070\u3001\u4f8b\u3048\u3070\u300110\/2\u306f5\u3068\u8a00\u3046\u7d50\u679c\u306b\u5bfe\u3057\u3066\u3001<br>3\u7cfb\u3067\u306f5.0\u3068\u306a\u308a\u307e\u3059\u3002<br>\u3053\u308c\u306f\u30012\u7cfb\u3067\u306f\u5207\u308a\u6368\u3066\u3066\u3044\u308b\u306e\u306b\u5bfe\u3057\u3066\u30013\u7cfb\u306f\u5207\u308a\u6368\u3066\u3066\u3044\u306a\u3044\u305f\u3081\u3067\u3059\u3002<br>3\u7cfb\u3067\u30012\u7cfb\u3068\u540c\u3058\u3088\u3046\u306b\u5207\u308a\u6368\u3066\u305f\u3044\u5834\u5408\u306f\u3001print(10\/\/2)\u3068\u3059\u308b\u3068\u51fa\u6765\u307e\u3059\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n<h2 id=\"i-12\">\u6587\u5b57\u5217\u3068\u6570\u5024\u306e\u9055\u3044<\/h2>\n<p>\u3055\u3066\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3069\u3046\u306a\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<pre><code>print(10 + 5)\nprint('10 + 5')\n<\/code><\/pre>\n<p>1\u884c\u76ee\u306eprint()\u3067\u306f\u300115\u304c\u51fa\u529b\u3055\u308c\u30012\u3067\u306f10 + 5\u304c\u51fa\u529b\u3055\u308c\u305f\u3067\u3057\u3087\u3046\u304b\uff1f<br>\u3053\u308c\u306f1\u3067\u306f\u6570\u5024\u306e\u8db3\u3057\u7b97\u306e\u7d50\u679c\u304c\u304b\u3048\u3063\u3066\u304d\u3066\u3044\u308b\u306e\u306b\u5bfe\u3057\u3066\u30012\u3067\u306f\u300c10 + 5\u300d\u3068\u3044\u3046\u6587\u5b57\u5217\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br>\u300c\u2019\u300d\u3084\u300c\u201d\u300d\u3067\u56f2\u3046\u3068\u3001\u6587\u5b57\u5217\u3068\u89e3\u91c8\u3055\u308c\u305d\u306e\u307e\u307e\u300c10 + 5\u300d\u304c\u51fa\u529b\u3055\u308c\u307e\u3057\u305f\u3002<br>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3067\u306f\u3001\u6587\u5b57\u5217\u3068\u6570\u5024\u306f\u5168\u304f\u7570\u306a\u308b\u3082\u306e\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\u3002<br>\u8a73\u3057\u304f\u306f\u6b21\u7ae0\u3001\u300c\u5909\u6570\u3068\u30c7\u30fc\u30bf\u578b\u300d\u3067\u8aac\u660e\u3057\u307e\u3059\u3002<br>\u3053\u3053\u3067\u306f\u3001<strong><em>\u6570\u5b57\u306b\u5bfe\u3057\u3066\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u53ca\u3073\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u56f2\u3080\u3068\u3001\u6587\u5b57\u5217\u3068\u3057\u3066\u6271\u308f\u308c\u308b\u3068\u3044\u3046\u3053\u3068\u3092\u77e5\u3063\u3066\u3044\u305f\u3060\u3051\u308c\u3070\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002<\/em><\/strong><\/p>\n<h2 id=\"i-13\">\u5909\u6570\u3068\u306f<\/h2>\n<p>\u5909\u6570\u3068\u306f\u3001\u30c7\u30fc\u30bf\uff08\u5024\uff09\u3092\u5165\u308c\u3066\u304a\u304f\u7bb1\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002<br>\u5909\u6570\uff08\u7bb1\uff09\u306b\u306f\u5909\u6570\u540d\uff08\u540d\u524d\uff09\u3092\u81ea\u7531\u306b\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\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>name = \"Tom\" # \u6587\u5b57\u5217\u3002\u300c'\u300d\u3067\u56f2\u3063\u3066\u3082\u540c\u3058\u3067\u3059\u3002\nage = 24 # \u6570\u5024\n<\/code><\/pre>\n<p>\u3053\u3053\u3067\u300c=\u300d\u304c\u51fa\u3066\u304d\u307e\u3057\u305f\u3002<br>\u5909\u6570\u306f\u300c\u5909\u6570\u540d = \u5024\u300d\u3068\u3059\u308b\u3053\u3068\u3067\u5b9a\u7fa9\u51fa\u6765\u307e\u3059\u3002<br>\u5909\u6570\u540d\u306f\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u7b49\u3067\u56f2\u3080\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br>\u307e\u305f\u3001\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u300c=\u300d\u306f\u7b49\u3057\u3044\u3068\u3044\u3046\u610f\u5473\u3067\u306f\u306a\u304f\u3001\u300c\u53f3\u8fba\u3092\uff08\u3053\u3053\u3067\u306fTom\u308424\uff09\u3001\u5de6\u8fba\u306b\u4ee3\u5165\u3059\u308b\u300d\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002<br>\u3064\u307e\u308a\u3001\u300c=\u300d\u306f\u4ee3\u5165\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002<br>\u3067\u306f\u5c11\u3057\u5fdc\u7528\u3067\u3059\u3002<br>print\u95a2\u6570\u3068\u5909\u6570\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u6b21\u306e\u3088\u3046\u306a\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code>name = \"Tom\"\nprint(name) # \u5909\u6570name\u3092()\u306b\u5165\u308c\u308b\u3068\u3001\u300cTom\u300d\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002\n\nprint(\"name\") # \u300cname\u300d\u3068\u3044\u3046\u6587\u5b57\u5217\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002\n<\/code><\/pre>\n<p>\u3067\u306f\u3001\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br>print(name)\u3068\u3059\u308b\u3068\u5909\u6570\u306b\u5165\u308c\u305f\u5024\u304c\u51fa\u529b\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001<br>print(\u201cname\u201d)\u3068\u3057\u305f\u5834\u5408\uff08\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u56f2\u3063\u3066\u3044\u308b\u5834\u5408\uff09<br>\u5909\u6570name\u3067\u306f\u306a\u304f\u3001\u6587\u5b57\u5217\u3068\u3057\u3066\u8a8d\u8b58\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>\u5148\u307b\u3069\u3001\u5909\u6570\u306b\u306f\u81ea\u7531\u306b\u540d\u524d\u3092\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3068\u8a00\u3044\u307e\u3057\u305f\u304c\u3001<br>\u5c11\u3057\u5b88\u308b\u30eb\u30fc\u30eb\u304c\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u3002<br>\u4f8b\u3048\u3070\u3001\u5909\u6570\u540d\u306e\u5148\u982d\u306f\u6570\u5b57\u3067\u66f8\u304f\u3053\u3068\u306f\u8a31\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002<br>\u6570\u5b57\u3067\u66f8\u3044\u305f\u5834\u5408\u3001\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002<br>\u307e\u305f\u3001\u300c\u6f22\u5b57\u300d\u3067\u5909\u6570\u3092\u5ba3\u8a00\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u307e\u3068\u3081\u308b\u3068\u3001<br>1. a\uff5ez\u306e\u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c8<br>2. \u6570\u5b57(\u5148\u982d\u4ee5\u5916)<br>3. _\uff08\u30a2\u30f3\u30c0\u30fc\u30b9\u30b3\u30a2\uff09<\/p>\n<p>\u306e3\u7a2e\u985e\u306e\u6587\u5b57\u3060\u3051\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br><a href=\"http:\/\/www.lifewithpython.com\/2013\/02\/rules-for-naming-identifiers-in-python.html\" target=\"_blank\" rel=\"noopener nofollow\">http:\/\/www.lifewithpython.com\/2013\/02\/rules-for-naming-identifiers-in-python.html<\/a><\/p>\n<p>\u3067\u306f\u3001\u5909\u6570\u3092\u4f7f\u3046\u7406\u7531\u306f\u4f55\u3067\u3057\u3087\u3046\u304b\uff1f<br>\u5909\u6570\u3092\u4f7f\u308f\u306a\u304f\u3066\u3082\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3067\u304d\u307e\u3059\u3002<br>\u3067\u3059\u304c\u3001\u4f7f\u3046\u30e1\u30ea\u30c3\u30c8\u3068\u3057\u3066\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u8aad\u3080\u6642\u306b\u305d\u306e\u30c7\u30fc\u30bf\u306e\u4e2d\u8eab\u304c\u4f55\u3092\u8868\u3057\u3066\u3044\u308b\u306e\u304b\u3001\u660e\u78ba\u306b\u306a\u308a\u30b3\u30fc\u30c9\u304c\u8aad\u307f\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<br>\u307e\u305f\u540c\u3058\u30c7\u30fc\u30bf\u3092\u7e70\u308a\u8fd4\u3057\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u305f\u308a\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4fee\u6b63\u3059\u308b\u6642\u306b<br>\u5909\u66f4\u7b87\u6240\u304c1\u7b87\u6240\u3067\u6e08\u3093\u3060\u308a\u30e1\u30ea\u30c3\u30c8\u3070\u304b\u308a\u3067\u3059\u306e\u3067\u5909\u6570\u3092\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u5909\u6570\u306f\u5024\u3092\u66f4\u65b0\u3057\u4e0a\u66f8\u304d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code>x = 10 # \u5909\u6570x\u3092\u5b9a\u7fa9\nprint(x) # 10\u304c\u51fa\u529b\n\nx = 20 # x\u306e\u5024\u309210\u304b\u308920\u306b\u4e0a\u66f8\u304d\u3002\nprint(x) # 20\u304c\u51fa\u529b\n<\/code><\/pre>\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u4e0a\u304b\u3089\u4e0b\u307e\u3067\u5b9f\u884c\u3055\u308c\u307e\u3059\u306e\u3067\u3001<br>\u6700\u521d\u3001\u5909\u6570x\u306b\u306f10\u304c\u4ee3\u5165\u3055\u308c\u307e\u3057\u305f\u304c\u3001\u9014\u4e2d\u306720\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067<br>\u4e0a\u66f8\u304d\u3055\u308c\u3066\u6700\u5f8c\u306e\u884c\u306eprint\u3067\u306f20\u304c\u51fa\u529b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5909\u6570\u306e\u4ee3\u5165\u306b\u306f\u3001\u7701\u7565\u7cfb\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre><code>x = x + 5 # x += 5\u3068\u540c\u3058\nx = x - 5 # x -= 5\u3068\u540c\u3058\nx = x * 5 # x *= 5\u3068\u540c\u3058\nx = x \/ 5 # x \/= 5\u3068\u540c\u3058\nx = x % 5 # x %= 5\u3068\u540c\u3058\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"i-13\">\u6587\u5b57\u5217\u306e\u9023\u7d50<\/h2>\n\n\n\n<p>Python\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u4e16\u754c\u3067\u306f\u3001\u56db\u5247\u6f14\u7b97\u306e\u300c+\u300d\u306b\u3088\u308b\u8a08\u7b97\u4ee5\u5916\u306b\u3082\u3001\u6587\u5b57\u5217\u306e\u9023\u7d50\u3082\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br>\u6587\u5b57\u5217\u306e\u9023\u7d50\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>print(\"Hello\" + \"World\") # +\u306b\u3088\u308a\u6587\u5b57\u5217\u540c\u58eb\u3092\u9023\u7d50 HelloWorld\u306b\u306a\u308b\u3002\nname = \"Tom\"\nprint(\"My name is \" + name) # My name is Tom\u306b\u306a\u308b\u3002\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-14\">\u5909\u6570<\/h2>\n\n\n\n<p><strong>\u5909\u6570\u3068\u306f\u4f55\u3089\u304b\u306e\u5024\u3092\u5165\u308c\u308b\u7bb1\u306e\u3088\u3046\u306a\u3082\u306e<\/strong>\u3067\u3059\u3002<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<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/camo.qiitausercontent.com\/7e8ef087d9cf44a90fb6b88b0a2bd3a5104384d8\/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3130353838372f30306566393036642d643531392d356331352d343761302d3036333665386632616231332e706e67\" alt=\"\"><\/figure>\n\n\n\n<p>\u203b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306b\u3088\u3063\u3066\u306f\u3001\u300c\u5909\u6570\u306f\u7bb1\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3042\u308b\u300d\u3068\u3044\u3046\u8868\u73fe\u304c\u6b63\u3057\u304f\u306a\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u306e\u7ae0\u3067\u306f\u521d\u5b66\u8005\u306b\u7406\u89e3\u3057\u3084\u3059\u3044\u8aac\u660e\u3092\u5fc3\u304c\u3051\u3066\u3044\u308b\u305f\u3081\u3001\u3042\u3048\u3066\u53b3\u5bc6\u3055\u306b\u6b20(\u304b)\u3044\u3066\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u56f3\u3067\u306f\u3001\u5909\u6570\u3068\u3044\u3046\u7bb1\u300clang\u300d\uff08\u7bb1\u306blang\u3068\u540d\u4ed8\u3051\uff09\u306b\u3001\u300cPython\u300d\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u5165\u308c\u3066\u3044\u307e\u3059\u3002<br>\u4e0a\u306e\u56f3\u3092Python\u306e\u30b3\u30fc\u30c9\u3067\u8868\u3059\u3068\u4ee5\u4e0b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>lang = \"Python\" # \u5909\u6570lang\u306b\u6587\u5b57\u5217Python\u3092\u4ee3\u5165 \n<\/code><\/pre>\n\n\n\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\n\n\n<pre class=\"wp-block-code\"><code>var = \"var\"\nVar = \"Var\"\nprint(var) # var\u3068\u51fa\u529b\u3055\u308c\u308b\nprint(Var) # Var\u3068\u51fa\u529b\u3055\u308c\u308b\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\nhello_world = \"Hello, World\" # \u63a8\u5968\nhelloworld  = \"Hello, World\" # \u975e\u63a8\u5968\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<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-15\">\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\n\n\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\n\n\n<pre class=\"wp-block-code\"><code>print(15 + 1)\nprint(15 - 2)\nprint(15 * 3)\nprint(15 \/ 4)\nprint(15 % 5)\n<\/code><\/pre>\n\n\n\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\n\n\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\n\n\n<pre class=\"wp-block-code\"><code>x = 220\nprint(x + 1)\nprint(x - 2)\nprint(x * 3)\nprint(x \/ 4)\nprint(x % 5)\n<\/code><\/pre>\n\n\n\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\n\n\n<h2 class=\"wp-block-heading\" id=\"i-16\">\u5b9a\u6570<\/h2>\n\n\n\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\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">\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\n\n\n<h2 class=\"wp-block-heading\" id=\"i-17\">\u4e88\u7d04\u8a9e<\/h2>\n\n\n\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\n\n\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\n\n\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\n\n\n<h2 class=\"wp-block-heading\" id=\"i-18\">\u5168\u4f53\u50cf<\/h2>\n\n\n\n<p>\u307e\u305a\u306f\u3058\u3081\u306b\u3001Python\u306b\u304a\u3051\u308b\u30c7\u30fc\u30bf\u578b\u306e\u5168\u4f53\u50cf\u3092\u4fef\u77b0\u3057\u307e\u3057\u3087\u3046\u3002<br>\u3053\u306e\u7ae0\u3067\u306f\u3001\u4e0b\u56f3\u306e\u6574\u6570\u578b\u3001\u6587\u5b57\u5217\u578b\u3001\u30ea\u30b9\u30c8\u578b\u3001\u8f9e\u66f8\u578b\u306b\u7d5e\u3063\u3066\u5b66\u3073\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/aiacademy.jp\/assets\/images\/data_type.png\" alt=\"\"><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-19\">\u5909\u6570\u3068\u578b<\/h2>\n\n\n\n<p>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306b\u3088\u3063\u3066\u306f\u3001\u5909\u6570\u3092\u5ba3\u8a00\u3059\u308b\u969b\u306b\u3001\u300c\u578b\u5ba3\u8a00\uff08\u3053\u306e\u5909\u6570\u306b\u306f\u3053\u306e\u578b\u3092\u683c\u7d0d\u3059\u308b\u3088\u3068\u3044\u3046\u5ba3\u8a00\uff09\u300d\u3092\u884c\u3046\u5fc5\u8981\u304c\u3042\u308b\u8a00\u8a9e\u304c\u3042\u308a\u307e\u3059\u3002<br>\u4f8b\u3048\u3070\u3001\u4ed6\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e(Java\u8a00\u8a9e\u3084C\u8a00\u8a9e\u306a\u3069)\u306f\u578b\u5ba3\u8a00\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<br>\u3067\u3059\u304c\u3001Python\u306e\u5909\u6570\u306b\u306f\u578b\u5ba3\u8a00\u304c\u5fc5\u8981\u306a\u3044\u305f\u3081\u3001\u5909\u6570\u306b\u3069\u306e\u3088\u3046\u306a\u578b\u3067\u3082\u5165\u308c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>x = 5\nprint(x) # 5\u304c\u51fa\u529b\u3055\u308c\u308b\u3002\nx = \"Python\" # \u554f\u984c\u306a\u304f\u4ee3\u5165\u53ef\u80fd\u3002\nprint(x) # Python\u3068\u51fa\u529b\u3055\u308c\u308b\u3002\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-20\">\u30c7\u30fc\u30bf\u578b<\/h2>\n\n\n\n<p>\u3053\u308c\u307e\u3067\u306b\u3001\u300c\u6587\u5b57\u5217\u300d\u3084\u300c\u6570\u5024\u300d\u3068\u3044\u3046\u5024\u3092\u898b\u3066\u304d\u307e\u3057\u305f\u3002<br>\u3053\u308c\u3089\u306f\u300c\u30c7\u30fc\u30bf\u578b\u300d\u3068\u547c\u3070\u308c\u3001\u69d8\u3005\u306a\u7a2e\u985e\u304c\u3042\u308a\u307e\u3059\u3002<br>\u4e3b\u306a\u3082\u306e\u306f\u3001\u6574\u6570\u578b\u3001\u6587\u5b57\u5217\u578b\u3001\u8f9e\u66f8\u578b\u3001\u30ea\u30b9\u30c8\u578b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-21\">\u6570\u5b57\uff08\u6570\u5024\u578b\uff09<\/h2>\n\n\n\n<p>\uff11\uff09\u6574\u6570(int)<br>\uff12\uff09\u5c0f\u6570\u30fb\u5b9f\u6570(float)<br>\uff13\uff09\u8907\u7d20\u6570<br>\u306e3\u3064\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-22\">\u6587\u5b57\u5217\u578b<\/h2>\n\n\n\n<p><strong>\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\uff08\u201d\u3068\u201d\uff09\u307e\u305f\u306f\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3(\u2018\u3068\u2019)\u3067\u56f2\u3046\u3068\u6587\u5b57\u5217\u306b\u306a\u308a\u307e\u3059\u3002<\/strong><br>\u6b21\u306e\u3088\u3046\u306b\u30013\u7a2e\u985e\u306e\u8a18\u8ff0\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># 1) \u30b7\u30f3\u30b0\u30eb\u30af\u30aa\u30c6\u30fc\u30b7\u30e7\u30f3\nstr1 = 'Hello World'\n# 2) \u30c0\u30d6\u30eb\u30af\u30aa\u30c6\u30fc\u30b7\u30e7\u30f3\nstr2 = \"Hello World\"\n# 3) \u30c8\u30ea\u30d7\u30eb\u30fb\u30c0\u30d6\u30eb\u30af\u30aa\u30c6\u30fc\u30b7\u30e7\u30f3\nstr3 = \"\"\"Hello World\nHello Python\"\"\"\n<\/code><\/pre>\n\n\n\n<p><strong>Python\u3067\u306f\u6587\u5b57\u5217\u578b\u3092\u5b9a\u7fa9\u3059\u308b\u4e0a\u3067\u3001\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\uff08\u201d\u3068\u201d\uff09\u3068\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3(\u2018\u3068\u2019)\u306e\u660e\u78ba\u306a\u4f7f\u3044\u5206\u3051\u306f\u3042\u308a\u307e\u305b\u3093\u306e\u3067\u3001\u3069\u3061\u3089\u304b\u597d\u304d\u306a\u65b9\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u578b\u3092\u5b9a\u7fa9\u3057\u3066\u9802\u3051\u305f\u3089\u3068\u601d\u3044\u307e\u3059\u3002<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>x = '1' # \u6587\u5b57\u5217\u578b\n<\/code><\/pre>\n\n\n\n<p>\u3055\u3089\u306b\u3001\u6587\u5b57\u5217\u578b\u3067\u306f+\u3068\uff0a\u306e2\u3064\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u304c\u3001<br>+\u306f\u6587\u5b57\u5217\u540c\u58eb\u3067\u4f7f\u3046\u5834\u5408\u3001<strong>\u7d50\u5408<\/strong>\u3068\u3044\u3046\u610f\u5473\u306b\u306a\u308a\u3001\u8907\u6570\u306e\u6587\u5b57\u5217\u30921\u3064\u306e\u6587\u5b57\u5217\u3068\u3057\u3066\u8868\u73fe\u3067\u304d\u307e\u3059\u3002<br>\u30a2\u30b9\u30bf\u30ea\u30b9\u30af\u8a18\u53f7(\uff0a)\u3092\u4f7f\u3046\u3068\u6587\u5b57\u5217\u3092<strong>\u53cd\u5fa9<\/strong>\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5b9f\u969b\u306b\u305d\u308c\u305e\u308c\u78ba\u8a8d\u3057\u3066\u898b\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u7d50\u5408\na = \"hello \" # \u7d50\u5408\u5f8c\u3001\u898b\u3084\u3059\u304f\u3059\u308b\u305f\u3081\u306b\u3001\u6700\u5f8c\u306b\u534a\u89d2\u30b9\u30da\u30fc\u30b9\u3092\u5165\u308c\u3066\u3044\u307e\u3059\u3002\nb = \"world\"\nprint(a + b) # hello world\n<\/code><\/pre>\n\n\n\n<p>\u6b21\u306b\u3001*\u3092\u4f7f\u3046\u4f8b\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u53cd\u5fa9\na = \"hello\"\nprint(a * 3) # hellohellohello\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-23\">\u578b\u5909\u63db(\u30ad\u30e3\u30b9\u30c8)<\/h2>\n\n\n\n<p>\u4e0b\u8a18\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u8a18\u8ff0\u3057\u3066\u5b9f\u969b\u306b\u3001\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>print(\"Hello\" + \"World\") # +\u306b\u3088\u308a\u6587\u5b57\u5217\u540c\u58eb\u3092\u9023\u7d50\nname = \"Tom\"\nprint(\"My name is \" + name)\nage = 24\n# \u4ee5\u4e0b\u306f\u3001\u30c7\u30fc\u30bf\u578b\u306e\u7570\u306a\u308b\u6587\u5b57\u5217\u578b\u3068\u6570\u5024\u578b\u3092\u9023\u7d50\u3057\u3066\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3044\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3059\u3002\nprint(\"My name is \" + name + \"My age is \" + age) # \u3053\u306e\u884c\u306f\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\n# TypeError: Can't convert 'int' object to str implicitly\n<\/code><\/pre>\n\n\n\n<p>\u3059\u308b\u3068\u3001<strong>TypeError: Can\u2019t convert \u2018int\u2019 object to str implicitly<\/strong>\u3068\u30a8\u30e9\u30fc\u304c\u3067\u307e\u3059\u3002<br>\u3053\u306e\u3088\u3046\u306b\u3001<strong><em>\u30c7\u30fc\u30bf\u578b\u306e\u7570\u306a\u308b\u6587\u5b57\u5217\u578b\u3068\u6570\u5024\u578b\u3092\u9023\u7d50\u3057\u305f\u5834\u5408\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/em><\/strong><br>\u305d\u3053\u3067\u3001\u3053\u306e\u30a8\u30e9\u30fc\u3092\u56de\u907f\u3059\u308b\u306b\u306f\u3001\u6570\u5024\u578b\u3092\u6587\u5b57\u5217\u578b\u306b\u5909\u63db\u3059\u308b\u3053\u3068\u3067\u3001\u6587\u5b57\u5217\u540c\u58eb\u306e\u9023\u7d50\u3068\u3057\u3066\u6271\u308f\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u3001\u9023\u7d50\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br>\u3053\u306e\u3088\u3046\u306b<strong>\u30c7\u30fc\u30bf\u578b\u3092\u5909\u3048\u308b\u3053\u3068\u3092\u300c\u578b\u5909\u63db\u300d\u307e\u305f\u306f\u300c\u30ad\u30e3\u30b9\u30c8\u300d\u3068\u547c\u3073\u307e\u3059\u3002<\/strong><br><strong>\u6570\u5024\u578b\u3092\u6587\u5b57\u5217\u578b\u306b\u5909\u63db\u3059\u308b\u306b\u306fstr()\u3092\u4f7f\u3044\u307e\u3059\u3002<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>name = \"Tom\"\nage = 24\nprint(\"My name is \" + name + \"My age is \" + str(age))\n\"\"\"\n\u5148\u307b\u3069\u3001\u6570\u5024\u578b\u3092\u6587\u5b57\u5217\u578b\u306b\u5909\u63db\u3057\u307e\u3057\u305f\u304c\u3001\u53cd\u5bfe\u306b\u6587\u5b57\u5217\u578b\u3092\u6570\u5024\u578b\u306b\u5909\u63db\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\n\u305d\u306e\u5834\u5408\u300cint\u300d\u3092\u7528\u3044\u307e\u3059\u3002\n\"\"\"\nstring_price = \"1000\"\nprice = 500\ntotal_price = int(string_price) + price\nprint(total_price) # 1500\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-24\">\u30ea\u30b9\u30c8\u578b<\/h2>\n\n\n\n<p>\u3053\u306e\u7bc0\u3067\u306f\u3001\u30ea\u30b9\u30c8\u578b\u3092\u8aac\u660e\u3057\u3066\u3044\u304d\u307e\u3059\u3002<br>\u30ea\u30b9\u30c8\u578b\u306f\u30c7\u30fc\u30bf\u578b\u306e\u4e2d\u3067\u3082\u3001\u304b\u306a\u308a\u5927\u4e8b\u306a\u578b\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u3057\u3063\u304b\u308a\u3068\u6271\u3048\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<br>\u3055\u3066\u3001<strong><em>\u5909\u6570\u306f\u30011\u3064\u306e\u30c7\u30fc\u30bf\u3057\u304b\u7ba1\u7406\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u304c\u3001\u30ea\u30b9\u30c8\u578b\u306f\u8907\u6570\u306e\u30c7\u30fc\u30bf(\u5909\u6570)\u3092\u7ba1\u7406\u3067\u304d\u307e\u3059\u3002<\/em><\/strong><br>\u4ed6\u306e\u8a00\u8a9e\u3067\u306f\u914d\u5217\u3068\u547c\u3070\u308c\u305f\u308a\u3057\u307e\u3059\u3002<br>Python\u306elist\u306f\u3001\u683c\u7d0d\u3059\u308b\u578b\u306e\u5b9a\u7fa9\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002<br>\u8907\u6570\u306e\u30c7\u30fc\u30bf\u3092\u7ba1\u7406\u3057\u305f\u3044\u5834\u5408\u306b\u30ea\u30b9\u30c8\u3092\u7528\u3044\u307e\u3059\u3002<br>list\u306f\u914d\u5217\u540d = [\u201cx\u201d,\u201dy\u201d,\u201dz\u201d]\u3068\u3044\u3046\u5f62\u5f0f\u3067\u5ba3\u8a00\u3057\u307e\u3059\u3002<br><strong>\u30ea\u30b9\u30c8\u306e\u4e2d\u8eab\u306f\u5de6\u304b\u3089\u6570\u3048\u59cb\u3081\u3001\u6700\u521d\u306f1\u3067\u306f\u306a\u304f\u30010\u304b\u3089\u6570\u3048\u308b\u306e\u3067\u6ce8\u610f\u3067\u3059\u3002<\/strong><br>\u3053\u306e<strong>\u30ea\u30b9\u30c8\u306e\u4e2d\u8eab\u306b\u3064\u3051\u3089\u308c\u305f\u756a\u53f7\u3092\u6dfb\u3048\u5b57(\u305d\u3048\u3058)\u3084\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306a\u3069\u3068\u547c\u3073\u307e\u3059\u3002<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-25\">\u30ea\u30b9\u30c8\u306e\u8ffd\u52a0<\/h2>\n\n\n\n<p><strong>append()\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001list\u306e\u672b\u5c3e\u306b\u8981\u7d20\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>li = []\nli.append(\"python)\nprint(li) # ['python']\nli.append(\"php\")\nprint(li) # ['python', 'php']\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-26\">\u8f9e\u66f8\u578b<\/h2>\n\n\n\n<p>\u8f9e\u66f8\u578b(\u30c7\u30a3\u30af\u30b7\u30e7\u30ca\u30ea\u30fc\u578b\uff09\u306fKey\u3068Value\u306e\u30da\u30a2\u3092\u4fdd\u6301\u3059\u308b\u30c7\u30fc\u30bf\u578b\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u6b21\u306f\u8f9e\u66f8\u578b\u306e\u69cb\u6587\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u8f9e\u66f8\u540d = {\"\u30ad\u30fc\" : \"\u5024\", \u30fb\u30fb\u30fb} \n<\/code><\/pre>\n\n\n\n<p><strong>\u30ea\u30b9\u30c8\u578b\u306f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7\u304c0\u304b\u3089\u59cb\u307e\u308a0\u304b\u3089\u9806\u306b\u5024\u304c\u683c\u7d0d\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u8f9e\u66f8\u578b\u306f{}\u3092\u4f7f\u3044\u56f2\u3044\u307e\u3059\u3002<\/strong><br>\u305d\u306e\u70b9\u306f\u3001\u8f9e\u66f8\u578b\u3068\u66f8\u304d\u65b9\u306f\u4f3c\u3066\u3044\u307e\u3059\u304c\u3001\u8f9e\u66f8\u578b\u306b\u306f\u30a4\u30f3\u30c7\u30c3\u30af\u30b90\u304b\u3089\u5024\u304c\u5272\u308a\u5f53\u3066\u3089\u308c\u3066\u3044\u307e\u305b\u3093\u3002<br>\u305d\u306e\u305f\u3081\u3001<strong>\u30ea\u30b9\u30c8\u306f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7\u3067\u5024\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u306e\u306b\u5bfe\u3057\u3001\u8f9e\u66f8\u578b\u3067\u306f\u4efb\u610f\u306e\u30ad\u30fc\u6587\u5b57\u5217\u3067\u5024\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/strong><\/p>\n\n\n\n<p>\u306f\u3058\u3081\u306b\u7c21\u5358\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u898b\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>profile = {\"name\": \"tani\", \"email\": \"kazunori-t@cyberbra.in\" }\nprint(profile[\"name\"]) # tani\n# \u65b0\u3057\u304f\u8981\u7d20\u3092\u8ffd\u52a0\nprofile[\"gender\"] = \"male\"\n# \u65b0\u3057\u304f\u8981\u7d20\u3092\u8ffd\u52a0\u3057\u305f\u8f9e\u66f8\u578b(profile)\u3092\u51fa\u529b\nprint(profile)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-27\">\u30ea\u30b9\u30c8\u578b\u3068\u8f9e\u66f8\u578b\u306e\u9055\u3044<\/h2>\n\n\n\n<p>\u3053\u3053\u307e\u3067\u30ea\u30b9\u30c8\u578b\u3068\u8f9e\u66f8\u578b\u3092\u5b66\u3093\u3067\u304d\u307e\u3057\u305f\u304c\u3001\u4e21\u8005\u306e\u9055\u3044\u306f\u4f55\u3067\u3057\u3087\u3046\u304b\u3002<br>\u305d\u308c\u306f<strong><em>\u8981\u7d20\u306e\u30a2\u30af\u30bb\u30b9\u306e\u4ed5\u65b9\u304c\u7570\u306a\u308b\u3053\u3068<\/em><\/strong>\u3067\u3059\u3002<br>\u30ea\u30b9\u30c8\u578b\u306f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9(\u6dfb\u3048\u5b57)\u3067\u8981\u7d20\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3057\u305f\u304c\u3001\u8f9e\u66f8\u578b\u306f\u30ad\u30fc\uff08\u6587\u5b57\u5217\u3084\u6570\u5024\uff09\u3067\u8981\u7d20\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<br>\u307e\u305f\u3001<strong>\u30ea\u30b9\u30c8\u578b\u306f[]\u3092\u4f7f\u3044\u307e\u3059\u304c\u3001\u8f9e\u66f8\u578b\u306f{}\u3092\u4f7f\u3046\u90e8\u5206\u3082\u7570\u306a\u308a\u307e\u3059\u3002<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-28\">\u30ea\u30b9\u30c8\u578b\u3068\u8f9e\u66f8\u578b\u306e\u5171\u901a\u3059\u308b\u3068\u3053\u308d<\/h2>\n\n\n\n<p>\u305d\u308c\u3067\u306f\u4e21\u8005\u304c\u5171\u901a\u3059\u308b\u90e8\u5206\u306f\u306a\u3093\u3067\u3057\u3087\u3046\u304b\u3002<br>\u5171\u901a\u3059\u308b\u90e8\u5206\u306f<strong>\u30ea\u30b9\u30c8\u578b\u3082\u8f9e\u66f8\u578b\u3082\u3001\u7570\u306a\u308b\u30c7\u30fc\u30bf\u578b(int\u3084str)\u306a\u3069\u306e\u8981\u7d20\u3092\u683c\u7d0d\u304c\u53ef\u80fd\u3067\u3042\u308b\u3068\u3044\u3046\u70b9\u3067\u3059\u3002<\/strong><br>\u307e\u305f\u3001\u8981\u7d20\u306e\u66f8\u304d\u63db\u3048\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-29\">\u5236\u5fa1\u69cb\u9020<\/h2>\n\n\n\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u3001\u4e0a\u304b\u3089\u4e0b\u306b\u51e6\u7406\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<br>\u6c7a\u3081\u3089\u308c\u305f\u6587\u6cd5\u3067\u51e6\u7406\u65b9\u6cd5\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<br>\u3053\u306e\u7ae0\u3067\u306f\u3001if\u6587\u3084Loop\u6587\u306a\u3069\u3092\u7fd2\u3044\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u6d41\u308c\u3092\u5236\u5fa1\u3059\u308b\u65b9\u6cd5\u3092\u5b66\u3073\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-30\">\u30d7\u30ed\u30b0\u30e9\u30e0\u51e6\u7406\u306e\u6d41\u308c<\/h2>\n\n\n\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u57fa\u672c\u7684\u306a\u6d41\u308c\u306f\u4e0a\u304b\u3089\u4e0b\u306e\u9806\u306b\u6d41\u308c\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/camo.qiitausercontent.com\/cf98ae393995cad9dabfbbc2e606fdf9534a4585\/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3130353838372f35323833646230312d346530352d313034652d333931352d3562366337323662336263332e706e67\" alt=\"\"><\/figure>\n\n\n\n<p>\u4e0a\u306e\u56f3\u3092Python\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u8a18\u8ff0\u3059\u308b\u3068\u3001\u4f8b\u3048\u3070\u4e0b\u8a18\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/aiacademy.jp\/assets\/images\/step_flow.png\" alt=\"\"><\/figure>\n\n\n\n<p>\u5b9f\u884c\u3059\u308b\u3068\u3001\u6b21\u306e\u5185\u5bb9\u304c\u9806\u306b\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u6700\u521d\u306e\u51e6\u7406\n\u6b21\u306e\u51e6\u7406\n\u6700\u5f8c\u306e\u51e6\u7406\n<\/code><\/pre>\n\n\n\n<p><strong><em>\u3064\u307e\u308a\u3001\u57fa\u672c\u7684\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u8a18\u8ff0\u3057\u305f\u9806\u306b\u4e0a\u304b\u3089\u4e0b\u3078\u3068\u6d41\u308c\u3066\u51e6\u7406\u3055\u308c\u307e\u3059\u3002<\/em><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-31\">\u30b3\u30fc\u30c9\u30d6\u30ed\u30c3\u30af\u3068\u30a4\u30f3\u30c7\u30f3\u30c8<\/h2>\n\n\n\n<p>Python\u3067\u306f\u3001\u30a4\u30f3\u30c7\u30f3\u30c8(\u5b57\u4e0b\u3052\uff09\u3067\u51e6\u7406\u3092\u307e\u3068\u3081\u307e\u3059\u3002<br>\u3053\u306e\u30a4\u30f3\u30c7\u30f3\u30c8\u306fPython\u306e\u5927\u4e8b\u306a\u7279\u5fb4\u306b\u306a\u308a\u307e\u3059\u3002<br>\u57fa\u672c\u7684\u306b\u306f\u3001\u534a\u89d2\u30b9\u30da\u30fc\u30b94\u3064\u3082\u3057\u304f\u306f\u30bf\u30d6\u30ad\u30fc\u304c\u30a4\u30f3\u30c7\u30f3\u30c8\u306e\u5f79\u5272\u306b\u306a\u308a\u307e\u3059\u304c\u3001Python\u306e\u6587\u6cd5\u3067\u306f\u3001<br>\u672b\u5c3e\u306b\u30b3\u30ed\u30f3\u300c:\u300d\u304c\u3064\u304f\u69cb\u6587\u304c\u591a\u3044\u3067\u3059\u3002<br>\uff08\u6761\u4ef6\u5206\u5c90\u6587\uff08if, elif, else)\u3001for\u6587\u3001while\u6587\u3001\u95a2\u6570\u3001\u30af\u30e9\u30b9\u306e\u5b9a\u7fa9\uff09<\/p>\n\n\n\n<p>\u672b\u5c3e\u306b:\u304c\u51fa\u3066\u304d\u305f\u3089\u3001\u30a4\u30f3\u30c7\u30f3\u30c8\u3092\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3068\u3044\u3046\u306e\u304cPython\u306e\u6c7a\u307e\u308a\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br>\u4f8b\u3048\u3070\u3001:\u304c\u3042\u308b\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u3057\u3066\u6b21\u3092\u898b\u3066\u304f\u3060\u3055\u3044\u3002<br>\u3053\u306e\u7ae0\u3067\u306f\u3001\u3053\u308c\u304b\u3089<strong>if\u6587\u53ca\u3073for\u6587<\/strong>\u306a\u3069\u3092\u8aac\u660e\u3057\u3066\u884c\u304d\u307e\u3059\u306e\u3067\u3001\u4eca\u306e\u6bb5\u968e\u3067\u306f\u4e0b\u8a18\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u610f\u5473\u304c\u7406\u89e3\u3067\u304d\u306a\u304f\u3066\u69cb\u3044\u307e\u305b\u3093\u3002<br>\u4e00\u65e6\u306f:\u304c\u51fa\u3066\u304d\u305f\u3089\u30a4\u30f3\u30c7\u30f3\u30c8\u304c\u5fc5\u8981\u3060\u3068\u3044\u3046\u3053\u3068\u3092\u7406\u89e3\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for i in range(10):\n    if i%2==0:\n        print(\"{} is even.\".format(i))\n    else:\n        print(\"{} is odd.\".format(i))\n\"\"\"\n\u51fa\u529b\u7d50\u679c\n0 is even.\n1 is odd.\n2 is even.\n3 is odd.\n4 is even.\n5 is odd.\n6 is even.\n7 is odd.\n8 is even.\n9 is odd.\n\"\"\"\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-32\">\u6761\u4ef6\u5206\u5c90 (if\u6587)<\/h2>\n\n\n\n<p>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3067\u306f\u3001\u3042\u308b\u6761\u4ef6\u306b\u5f53\u3066\u306f\u307e\u308b\u304b\u3069\u3046\u304b\u306b\u3088\u3063\u3066\u51e6\u7406\u3092\u5206\u3051\u307e\u3059\u3002<br>\u4f8b\u3048\u3070\u300c\u30c6\u30b9\u30c8\u306e\u70b9\u6570\uff08\u6761\u4ef6\uff09\u306b\u3088\u3063\u3066\u6210\u7e3e\uff08\u51e6\u7406\uff09\u3092\u5909\u3048\u308b\u300d\u3068\u3044\u3046\u306e\u3082\u6761\u4ef6\u5206\u5c90\u3067\u8868\u3059\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<br>\u69cb\u6587\u3068\u3057\u3066\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u6ce8) \u3053\u306e\u30b3\u30fc\u30c9\u306f\u52d5\u4f5c\u3057\u306a\u3044\u306e\u3067\u6ce8\u610f\u3067\u3059\u3002\nif \u6761\u4ef6A:\n    \u6761\u4ef6A\u304cTrue\u306a\u3089\u5b9f\u884c\nelif \u6761\u4ef6B:\n    \u6761\u4ef6A\u304cFalse\u304b\u3064\u6761\u4ef6B\u304cTrue\u306a\u3089\u5b9f\u884c\nelse:\n    \u6761\u4ef6A\u3082B\u3082False\u306a\u3089\u5b9f\u884c\n<\/code><\/pre>\n\n\n\n<p>if\u6587\u3092\u7528\u3044\u308b\u3068\u300c\u3082\u3057\u25cb\u25cb\u306a\u3089\u3070\u2613\u2613\u3092\u884c\u3046\u300d\u3068\u3044\u3046\u51e6\u7406\u3092\u3001\u6761\u4ef6\u5206\u5c90\u306b\u3088\u3063\u3066\u8868\u73fe\u3067\u304d\u307e\u3059\u306e\u3067\u3001\u4f8b\u3048\u3070\u3001\u30c6\u30b9\u30c8\u306e\u70b9\u6570\u304c\u304c78\u70b9\u4ee5\u4e0a\u3067\u3042\u308c\u3070\u3001\u5408\u683c\u3068\u51fa\u529b\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u6b21\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># if\u306e\u5f8c\u306b\u6761\u4ef6\u5f0f\u3092\u6307\u5b9a\u3057\u3001\u305d\u306e\u6761\u4ef6\u304c\u6210\u308a\u7acb\u3064\u3068\u304d\u306b\u5b9f\u884c\u3059\u308b\u51e6\u7406\u3092\u6b21\u306e\u884c\u306b\u66f8\u304d\u307e\u3059\u3002\nscore = 80\nif score &gt; 78: # \u6bd4\u8f03\u6f14\u7b97\u5b50 &gt; \u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002\u6bd4\u8f03\u6f14\u7b97\u5b50\u306f\u3053\u306e\u5f8c\u306b\u8aac\u660e\u3057\u307e\u3059\u3002\n    print(\"\u5408\u683c\u3067\u3059\")\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-33\">\u6761\u4ef6\u5f0f\u306e\u4f5c\u308a\u65b9<\/h2>\n\n\n\n<p><strong>\u6761\u4ef6\u5f0f\u306e\u4e2d\u3067\u306f\u3001\uff12\u3064\u306e\u5024\u3092\u6bd4\u8f03\u3059\u308b\u305f\u3081\u306e\u8a18\u53f7\u300c\u6bd4\u8f03\u6f14\u7b97\u5b50\u300d\u304c\u3088\u304f\u4f7f\u308f\u308c\u307e\u3059\u3002<\/strong><br>\u6bd4\u8f03\u6f14\u7b97\u5b50\u306b\u306f\u4e0b\u8a18\u306e\u753b\u50cf\u306e\u3088\u3046\u306a\u6f14\u7b97\u5b50\u304c\u3042\u308a\u307e\u3059\u3002<br>\u53f3\u8fba\u3068\u5de6\u8fba\u304c\u7b49\u3057\u3044\u304b\u3069\u3046\u304b\u3092\u8868\u3059\u306b\u306f == \u3092\u4f7f\u3044\u307e\u3059\u3002<br>\u307e\u305f\u3001\u53f3\u8fba\u3068\u5de6\u8fba\u304c\u7b49\u3057\u304f\u306a\u3044\u304b\u3069\u3046\u304b\u3092\u8868\u3059\u306b\u306f != \u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/camo.qiitausercontent.com\/750038a97ce8ebafe5c31350efa8e0a79290f7d2\/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3130353838372f33663239363737302d313634322d386662362d656666302d6632663661666563343032342e706e67\" alt=\"\"><\/figure>\n\n\n\n<p><strong>\u6761\u4ef6\u90e8\u5206\u306f\u3001\u300cif \u6761\u4ef6\u5f0f :\u300d\u306e\u3088\u3046\u306b\u66f8\u304d\u307e\u3059\u3002<\/strong><br>\u884c\u672b\u306e\u30b3\u30ed\u30f3\u3092\u3064\u3051\u5fd8\u308c\u308b\u3068\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u306e\u3067\u6ce8\u610f\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>score = 80\nif score &gt; 78: # \u6bd4\u8f03\u6f14\u7b97\u5b50 &gt; \u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002\n    print(\"\u5408\u683c\u3067\u3059\u3002\u304a\u3081\u3067\u3068\u3046\uff01\")\nelse:\n    print(\"\u4e0d\u5408\u683c\u3002\u6b21\u56de\u9811\u5f35\u308a\u307e\u3057\u3087\u3046\u3002\")\nscore = 100\nif score == 100:\n    print(\"\u6e80\u70b9\")\nelif score &gt; 85:\n    print(\"\u5408\u683c\uff01\")\nelse:\n    print(\"\u4e0d\u5408\u683c\u3002\u6b21\u56de\u9811\u5f35\u308a\u307e\u3057\u3087\u3046\u3002\")\n<\/code><\/pre>\n\n\n\n<p>Python\u3067\u306f\u30b3\u30fc\u30c9\u306e\u5b57\u4e0b\u3052\uff08\u30a4\u30f3\u30c7\u30f3\u30c8\/\u534a\u89d2\u30b9\u30da\u30fc\u30b92\u3082\u3057\u304f\u306f4\u3064\uff09\u304c\u305d\u306e\u307e\u307e\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u52d5\u4f5c\u306b\u5f71\u97ff\u3057\u307e\u3059\u306e\u3067\u3001\u5b57\u4e0b\u3052\uff08\u30a4\u30f3\u30c7\u30f3\u30c8\uff09\u306b\u6c17\u3092\u3064\u3051\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-34\">\u30eb\u30fc\u30d7<\/h2>\n\n\n\n<p>\u307b\u3068\u3093\u3069\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3067\u5236\u5fa1\u69cb\u6587\u306e\u57fa\u672c\u306f\u30eb\u30fc\u30d7\u3067\u3059\u3002<br>\u30eb\u30fc\u30d7\u306f\u8907\u6570\u56de\u540c\u3058\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u5236\u5fa1\u69cb\u6587\u3067\u3059\u3002<br>\u3088\u304f\u3001\u30ea\u30b9\u30c8\u306e\u5404\u8981\u7d20\u306b\u540c\u3058\u51e6\u7406\u3092\u3057\u305f\u3044\u3068\u304d\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-35\">for\u6587<\/h2>\n\n\n\n<p>for\u6587\u306b\u3088\u308b\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u898b\u3066\u3044\u304d\u307e\u3059\u3002<br>for\u6587\u306e\u66f8\u5f0f\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"\"\"\nfor \u30eb\u30fc\u30d7\u5185\u5909\u6570 in \u30ea\u30b9\u30c8\u540d:\n    \u5b9f\u884c\u3059\u308b\u51e6\u7406\n\"\"\"\nfor i in [\"apple\", \"banana\", \"melon\"]:\n    print(i)\n# \u51fa\u529b\u7d50\u679c\n\"\"\"\napple\nbanana\nmelon\n\"\"\"\n<\/code><\/pre>\n\n\n\n<p>\u30ea\u30b9\u30c8\u304c\u30eb\u30fc\u30d7\u5185\u5909\u6570\u306ei\u306b\u683c\u7d0d\u3055\u308c\u3001\u305d\u308c\u304c\u51fa\u529b(print)\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br>\u8a73\u3057\u304f\u8aac\u660e\u3057\u307e\u3059\u3002<br>\u307e\u305a\u3001\u5148\u982d\u306eapple(\u6dfb\u3048\u5b570\u756a\u76ee)\u3068\u3044\u3046\u8981\u7d20\u304c\u5909\u6570i\u306b\u4ee3\u5165\u3055\u308c\u3001print(i)\u3067\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<br>\u6b21\u306b\u3001banana\u304c\u53d6\u308a\u51fa\u3055\u308c\u3001i\u306b\u4ee3\u5165\u3001\u6700\u5f8c\u306emelon\u3082\u540c\u69d8\u306bi\u306b\u4ee3\u5165\u3055\u308c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<br>\u30ea\u30b9\u30c8\u306e\u8981\u7d20\u3092\u5168\u3066\u53d6\u308a\u51fa\u3057\u305f\u305f\u3081\u3001\u3053\u306efor\u6587\u306e\u51e6\u7406\u306f\u305d\u306e\u6642\u70b9\u3067\u7d42\u4e86\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>for\u6587\u3067\u4e00\u5b9a\u56de\u6570\u306e\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u3092\u884c\u3046\u306b\u306f<strong>range()\u95a2\u6570<\/strong>\u3092\u7528\u3044\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<p>range()\u95a2\u6570\u306f\u6b21\u306e\u3088\u3046\u306a\u5f79\u5272\u3092\u6301\u3061\u307e\u3059\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>range(x): 0\u304b\u3089x-1\u307e\u3067\u306e\u9023\u756a\u306e\u30ea\u30b9\u30c8\u3092\u8fd4\u3059<br>range(x,y): x\u304b\u3089y-1\u307e\u3067\u306e\u9023\u756a\u306e\u30ea\u30b9\u30c8\u3092\u8fd4\u3059<\/p>\n<\/blockquote>\n\n\n\n<p>\u4f8b\u3048\u3070\u3001range()\u3092\u7528\u3044\u3066\u30010~9\u307e\u3067\u306e\u8a0810\u56de\u7e70\u308a\u8fd4\u3059\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for i in range(10):\n    print(i)\n# \u51fa\u529b\u7d50\u679c\n\"\"\"\n0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n\"\"\"\n<\/code><\/pre>\n\n\n\n<p>\u4ed6\u306e\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u306e\u4f8b\u3082\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br>\u5c11\u3057\u9577\u3044\u3067\u3059\u304c\u3001\u3058\u3063\u304f\u308a\u8aad\u3093\u3067\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>data = [20, 40, 60, 88]\nfor d in data:\n    print(d)\n# \u51fa\u529b\u7d50\u679c\n\"\"\"\n20\n40\n60\n88\n\"\"\"\n# (1)\nsum_d = 0\nfor d in data:\n    # *=\u3067\u3001\u304b\u3051\u308f\u305b\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\n    sum_d += d # sum_d = sum_d + d\u3092\u7701\u7565\u3057\u305f\u66f8\u304d\u65b9\u3067\u3059\u3002\nprint(sum_d) # 208\u304c\u51fa\u529b\u300220 + 40 + 60 + 88\u3092\u8db3\u3057\u5408\u308f\u305b\u305f\u6570\u3002\n\"\"\"\n\u51fa\u529b\u7d50\u679c\n208\n\"\"\"\n# for\u6587\u306felse\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002\nsum_d = 0\n# (2)\nfor d in data:\n    sum_d += d\n# \u30eb\u30fc\u30d7\u304c\u7d42\u308f\u3063\u305f\u30891\u56de\u51e6\u7406\u3057\u305f\u3044\u3082\u306e\u304c\u51e6\u7406\u3067\u304d\u308b\u3002\nelse:\n    print(sum_d)\n\"\"\"\n\u51fa\u529b\u7d50\u679c\n208\n\"\"\"\n\"\"\"\nPython\u3067\u306f\u3001\u3053\u3053\u3067\u898b\u305ffor\u6587\u3001\u5f8c\u304b\u3089\u898b\u308bWhile\u6587\u306e\u30eb\u30fc\u30d7\u3067else\u3092\u4f7f\u3046\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002\nelse\u3092\u8a18\u8ff0\u3059\u308b\u3068\u3001\u30eb\u30fc\u30d7\u304c\u7d42\u4e86\u3059\u308b\u3068\u304d\u306belse\u306e\u4e2d\u304c\u51e6\u7406\u3055\u308c\u307e\u3059\u3002\n\"\"\"\n# \u4e0a\u306e(1)\u3068(2)\u306felse\u3092\u4f7f\u3063\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u306e\u9055\u3044\u3067\u3059\u304c\u3001\u51fa\u529b\u7d50\u679c\u306f\u540c\u3058\u3067\u3059\u3002\n## break\u3068continue\n# cotinue 1\u56de\u30b9\u30ad\u30c3\u30d7\nfor i in range(10):\n    if i == 3:\n        continue\n    print(i)\n\"\"\"\n\u51fa\u529b\u7d50\u679c\n0\n1\n2\n4\n5\n6\n7\n8\n9\n\"\"\"\n# break \u51e6\u7406\u3092\u7d42\u4e86\nfor i in range(10):\n    if i == 3:\n        break\n    print(i) # 0 1 2\u3092\u51fa\u529b\n\"\"\"\n\u51fa\u529b\u7d50\u679c\n0\n1\n2\n\"\"\"\n\"\"\"\n\u5148\u307b\u3069\u898b\u305felse\u3092for\u6587\u3068\u4f7f\u3046\u969b\u306b\u3001\u300cbreak\u300d\u3092\u4f7f\u3046\u3068\u3001else\u306e\u4e2d\u306e\u51e6\u7406\u306f\u5b9f\u884c\u3055\u308c\u306a\u3044\u306e\u3067\u6ce8\u610f\u3067\u3059\u3002\n\u3053\u306e\u5834\u5408\u3067\u3059\u3068\u3001\u30ea\u30b9\u30c8\u5185\u306b\"f\"\u304c\u3042\u308b\u306e\u3067\u3001found\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u304c\u3001\nelse\u5185\u306enot found\u306f\u51fa\u529b\u3055\u308c\u307e\u305b\u3093\u3002\n\"\"\"\ndata = [1, 2, 3, 4, 5, \"f\"]\nfor x in data:\n    if x == 'f':\n        print('found')\n        break\nelse:\n    print('not found') # \u3053\u306e\u30b5\u30f3\u30d7\u30eb\u306e\u5834\u5408else\u306e\u51e6\u7406\u306f\u5b9f\u884c\u3055\u308c\u306a\u3044\uff01\n\"\"\"\n\u51fa\u529b\u7d50\u679c\nfound\n\"\"\"\n<\/code><\/pre>\n\n\n\n<p>python\u306efor\u306fiterator\uff08\u30a4\u30c6\u30ec\u30fc\u30bf)\u3068\u547c\u3070\u308c\u308b\u4ed5\u7d44\u307f\u3067\u3001<br>\u30bf\u30d7\u30eb\u3084\u3001\u6587\u5b57\u5217\u3001\u8f9e\u66f8\u306a\u3069\u3082key\u3068\u3057\u3066\u4f7f\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for char in \"hello\":\n    print(char)\n\"\"\"\nh\ne\nl\nl\no\n\"\"\"\n<\/code><\/pre>\n\n\n\n<p>\u30ea\u30b9\u30c8\u306e\u8981\u7d20\u3092\u9806\u306b\u51e6\u7406\u3057\u3064\u3064\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7\u3082\u77e5\u308a\u305f\u3044\u5834\u5408\u304c\u3042\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<br>\u305d\u306e\u5834\u5408\u3001<strong>enumerate()<\/strong>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for index, name in enumerate([\"apple\", \"banana\", \"melon\"]):\n    print(index, name)\n\"\"\"\n0 apple\n1 banana\n2 melon\n\"\"\"\n<\/code><\/pre>\n\n\n\n<p>\u307e\u305flist()\u3068range()\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306a1~100\u307e\u3067\u306e\u8981\u7d20\u3092\u6301\u3063\u305f\u30ea\u30b9\u30c8\u3092\u7c21\u6f54\u306b\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3082\u51fa\u6765\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>print(list(range(101)))\n\"\"\"\n# \u51fa\u529b\u7d50\u679c\n[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100]\n\"\"\"\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-36\">\u8f9e\u66f8\u578b\u306e\u30c7\u30fc\u30bf\u3092\u30eb\u30fc\u30d7\u3059\u308b<\/h2>\n\n\n\n<p>\u8f9e\u66f8\u578b\u306e\u30c7\u30fc\u30bf\u3092\u30eb\u30fc\u30d7\u3059\u308b\u306b\u306f\u6b21\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>data = {\"tani\": 21, \"kazu\": 22, \"python\": 100}\nfor key, value in data.items():\n     print(\"key: {} value: {}\".format(key, value))\n\"\"\"\nkey: tani value: 21\nkey: kazu value: 22\nkey: python value: 100\n\"\"\"\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-37\">while\u6587<\/h2>\n\n\n\n<p><strong>while\u6587\u306f\u3001\u7279\u5b9a\u6761\u4ef6\u3092\u6e80\u305f\u3059\u307e\u3067\u30eb\u30fc\u30d7\u3092\u7e70\u308a\u8fd4\u3057\u307e\u3059\u3002<\/strong><br>\u301c\u306e\u9593\u306f\u305a\u3063\u3068\u30eb\u30fc\u30d7\u3068\u3044\u3063\u305f\u30a4\u30e1\u30fc\u30b8\u3067\u3001for\u307b\u3069\u4f7f\u3046\u983b\u5ea6\u306f\u5c11\u306a\u3044\u3067\u3059\u304c\u3001<br>\u660e\u793a\u7684\u306b\u7121\u9650\u30eb\u30fc\u30d7\u3092\u884c\u3044\u305f\u3044\u5834\u5408\u306f\u3001while\u3067\u306e\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># n\u304c10\u306b\u306a\u308b\u307e\u3067\u7e70\u308a\u8fd4\u3057\nn = 0\nwhile n &lt; 10:\n    print(n)\n    n += 1 # +1\u3059\u308b\u306e\u3092\u5fd8\u308c\u305a\u306b\u3002\n\"\"\"\n\u51fa\u529b\u7d50\u679c\n0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n\"\"\"\n<\/code><\/pre>\n\n\n\n<p><strong><em>n += 1\u3082\u3057\u304f\u306f\u3001n = n + 1\u3092\u8a18\u8ff0\u3057\u306a\u3044\u5834\u5408\u3001\u7121\u9650\u30eb\u30fc\u30d7\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/em><\/strong><br>\u7121\u9650\u30eb\u30fc\u30d7\u306b\u5165\u3063\u305f\u3089\u3001Ctrl + c\u3067\u7d42\u4e86\u3057\u3066\u3042\u3052\u307e\u3057\u3087\u3046\u3002<br>\u7121\u9650\u30eb\u30fc\u30d7\u306b\u306a\u3089\u306a\u3044\u3088\u3046\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-38\">\u7121\u9650\u30eb\u30fc\u30d7<\/h2>\n\n\n\n<p>\u3061\u306a\u307f\u306b\u3001\u7121\u9650\u30eb\u30fc\u30d7\u3092\u6545\u610f\u306b\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u66f8\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u7121\u9650\u30eb\u30fc\u30d7\u3067\u3059\u306e\u3067\u3001\u4e0b\u8a18\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408\u306f\u3001Ctrl + c\u3067\u7d42\u4e86\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n# \u3082\u3057\u304f\u306f\u30bf\u30fc\u30df\u30ca\u30eb\/\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u5f37\u5236\u7684\u306b\u7d42\u4e86\uff08\u9589\u3058\u3066\uff09\u304f\u3060\u3055\u3044\u3002\nwhile True:\n    print(\"\u7121\u9650\u30eb\u30fc\u30d7\")\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-39\">\u30ea\u30b9\u30c8\u5185\u5305\u8868\u8a18<\/h2>\n\n\n\n<p><strong>\u30ea\u30b9\u30c8\u5185\u5305\u8868\u8a18(List Comprehensions)\u306f\u65e2\u5b58\u306e\u30ea\u30b9\u30c8\u3084\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u304b\u3089\u65b0\u3057\u3044\u30ea\u30b9\u30c8\u3092\u4f5c\u308b\u3082\u306e\u3067\u3059\u3002<\/strong><br>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306f1\u304b\u308910\u307e\u3067\u306e\u6570\u5024\u3092\u305d\u308c\u305e\u308c2\u4e57\u3057\u305f\u6570\u5024\u306e\u30ea\u30b9\u30c8\u3092\u4f5c\u308b\u5834\u5408\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3001\u30ea\u30b9\u30c8\u5185\u5305\u8868\u8a18\u3067\u8a18\u8ff0\u3057\u305f\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>result = [x**2 for x in range(1,11)]\nprint(result) # [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]\n# \u901a\u5e38\u306e\u30eb\u30fc\u30d7\u3067\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\nresult = []\nfor i in range(1,11):\n    result.append(i**2)\nprint(result) # [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]\n<\/code><\/pre>\n\n\n\n<p><strong>\u30ea\u30b9\u30c8\u5185\u5305\u8868\u8a18\u306f\u3001\u65e2\u5b58\u306e\u30ea\u30b9\u30c8\u304b\u3089\u53d6\u308a\u51fa\u3057\u305f\u8981\u7d20\u306b\u5bfe\u3057\u51e6\u7406\u3092\u3059\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u6761\u4ef6\u306b\u5fdc\u3058\u305f\u5834\u5408\u306b\u3060\u3051\u65b0\u3057\u3044\u30ea\u30b9\u30c8\u306b\u8ffd\u52a0\u3057\u305f\u3044\u5834\u5408\u306b\u3082\u4f7f\u3048\u307e\u3059\u3002<\/strong><br>\u5185\u5305\u8868\u8a18\u306e\u30e1\u30ea\u30c3\u30c8\u306f\u3001\u51e6\u7406\u3092\u7c21\u6f54\u306b\u66f8\u3051\u3001\u65b0\u3057\u3044\u30ea\u30b9\u30c8\u306a\u3069\u3078\u306e\u8ffd\u52a0\u30e1\u30bd\u30c3\u30c9\u306e\u547c\u3073\u51fa\u3057\u306b\u304b\u304b\u308b\u30b3\u30b9\u30c8\u3092\u8efd\u6e1b\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-40\">\u305d\u306e\u4ed6\u5185\u5305\u8868\u8a18<\/h2>\n\n\n\n<p>\u30ea\u30b9\u30c8\u5185\u5305\u8868\u8a18\u4ee5\u5916\u306b\u3082\u3001\u30bb\u30c3\u30c8\u3068\u8f9e\u66f8\u3092\u751f\u6210\u3059\u308b\u5185\u5305\u8868\u8a18\u3082\u3042\u308a\u307e\u3059\u3002<br><strong><em>\u30bb\u30c3\u30c8\u3068\u8f9e\u66f8\u5185\u5305\u8868\u8a18\u306e\u5834\u5408\u3001\u751f\u6210\u3059\u308b\u5024\u306b\u3088\u3063\u3066\u306f\u51fa\u529b\u3055\u308c\u308b\u5024\u306e\u9806\u756a\u304c\u4fdd\u6301\u3055\u308c\u306a\u3044\u5834\u5408\u3082\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u5229\u7528\u306e\u969b\u306b\u306f\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\u3002<\/em><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>s = {x**2 for x in range(1,6)}\nprint(s) # {1, 4, 9, 16, 25}\n<\/code><\/pre>\n\n\n\n<p>\u8f9e\u66f8\u5185\u5305\u8868\u8a18\u306e\u66f8\u304d\u65b9\u306f\u3001\u30ad\u30fc\u3068\u5024\u3092\u30b3\u30ed\u30f3\u300c:\u300d\u3067\u533a\u5207\u308a\u3001<br>\u30bb\u30c3\u30c8\u5185\u5305\u8868\u8a18\u3068\u540c\u69d8\u306b{}\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>d = {x*2:x**2 for x in range(1,11)}\nprint(d) # {2: 1, 4: 4, 6: 9, 8: 16, 10: 25, 12: 36, 14: 49, 16: 64, 18: 81, 20: 100}\n<\/code><\/pre>\n\n\n\n<p>\u307e\u305f\u3001tuple\u5185\u5305\u8868\u8a18\u306b\u95a2\u3057\u3066\u3067\u3059\u304c\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3059\u308b\u3068generator\uff08\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\uff09\u306b\u306a\u308a\u307e\u3059\u3002<br>()\u3067\u5b9a\u7fa9\u3059\u308b\u3068\u3001\u30bf\u30d7\u30eb\u5185\u5305\u8868\u8a18\u306b\u306f\u306a\u308a\u307e\u305b\u3093\u306e\u3067\u6ce8\u610f\u3067\u3059\u3002<br>\u8fd4\u3063\u3066\u304f\u308b\u306e\u306f\u8981\u7d20\u3092\u751f\u6210\u3059\u308bgenerator\u306b\u306a\u308a\u307e\u3059\u3002<br>\u203bgenerator\u3068\u3044\u3046\u8a00\u8449\u306e\u610f\u5473\u306f\u4e00\u65e6\u7406\u89e3\u3057\u306a\u304f\u3066\u69cb\u3044\u307e\u305b\u3093\u3002<br>tuple\u306e\u6642\u306f\u30bb\u30c3\u30c8\u578b\u3068\u8f9e\u66f8\u578b\u3068\u306f\u9055\u3044generator\u304c\u8fd4\u3063\u3066\u304d\u3066\u3001list()\u3067\u30ad\u30e3\u30b9\u30c8\u3059\u308b\u3068\u5185\u5305\u8868\u8a18\u3092\u5b9f\u73fe\u3067\u304d\u308b\u3068\u3044\u3046\u306e\u3092\u77e5\u3063\u3066\u3044\u308c\u3070\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002<br><strong><em>tuple\u306b\u3059\u308b\u969b\u306b\u306f\u3001tuple()\u3067\u30ad\u30e3\u30b9\u30c8\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/em><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>t = (x for x in range(5))\nprint(t)\n# &lt;generator object &lt;genexpr&gt; at 0x1095c8eb8&gt;\nt = tuple([x for x in range(5)])\nprint(t) # (0, 1, 2, 3, 4)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-41\">\u6a19\u6e96\u5165\u529b<\/h2>\n\n\n\n<p><strong>input()\u3092\u7528\u3044\u308b\u3053\u3068\u3067\u3001\u30e6\u30fc\u30b6\u304b\u3089\u306e\u5165\u529b\u3092\u53d7\u3051\u53d6\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/strong><br>\u203bPython \u30d0\u30fc\u30b8\u30e7\u30f32\u7cfb\u3067\u306f\u3001raw_input()\u3067\u3057\u305f\u304c\u3001Python3\u7cfb\u3067\u306f\u3001raw_input()\u306f\u4f7f\u3048\u305a\u3001input()\u3092\u4f7f\u3044\u307e\u3059\u3002<br>\u4ee5\u4e0b\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u30b3\u30f3\u30bd\u30fc\u30eb(Mac\u306e\u65b9\u306f\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u3001WIndows\u306e\u65b9\u306f\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8)\u306e\u5165\u529b\u304c\u5f85\u3061\u72b6\u614b\u306b\u306a\u308a\u3001\u4f55\u304b\u3092\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u5165\u529b\u3059\u308b\u3068input()\u3067\u5165\u529b\u5024\u3092\u53d7\u3051\u53d6\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>print(\"\u540d\u524d\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\")\nname = input()\nprint(\"\u3042\u306a\u305f\u306e\u540d\u524d\u306f\"+name+\"\u3067\u3059\")\n<\/code><\/pre>\n\n\n\n<p><strong><em>\u3053\u3053\u30671\u3064\u6ce8\u610f\u3067\u3059\u304c\u3001input()\u3092\u4f7f\u3063\u3066\u53d7\u3051\u53d6\u3063\u305f\u5024\u306f\u3001\u6587\u5b57\u5217\u578b\u306b\u306a\u308a\u307e\u3059\u3002<\/em><\/strong><br>\u6570\u5024\u3092\u5165\u529b\u3057\u305f\u5834\u5408\u3001\u6587\u5b57\u5217\u578b\u306b\u30ad\u30e3\u30b9\u30c8\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u306e\u3067\u3001\u305d\u306e\u5f8c\u306e\u6570\u5024\u51e6\u7406\u306b\u306f\u6c17\u3092\u3064\u3051\u3066\u304f\u3060\u3055\u3044\u3002<br>\uff08\u4e00\u65e6int()\u7b49\u3067\u30ad\u30e3\u30b9\u30c8\u3092\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002\uff09<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306f\u7121\u9650\u306b\u30e6\u30fc\u30b6\u304c\u5165\u529b\u3057\u305f\u5185\u5bb9\u3092\u51fa\u529b\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3059\u3002<br><strong>\u53d7\u3051\u53d6\u3063\u305f\u5024\u3092\u5909\u6570i\u306b\u4ee3\u5165\u3057\u3001print()\u3067i\u3092\u51fa\u529b\u3057\u307e\u3059\u3002<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Ctr-C\u3067\u7d42\u4e86\u3057\u307e\u3059\u3002\nwhile True:\n    print(\"Please Input!\")\n    i = input()\n    print(i)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-42\">\u95a2\u6570\u3068\u306f<\/h2>\n\n\n\n<p><strong><em>\u95a2\u6570\u3068\u306f\u3042\u308b\u30c7\u30fc\u30bf\u3092\u53d7\u3051\u53d6\u308a\u3001\u5b9a\u3081\u3089\u308c\u305f\u72ec\u81ea\u306e\u51e6\u7406\u3092\u5b9f\u884c\u3057\u3001\u305d\u306e\u7d50\u679c\u3092\u8fd4\u3059\u547d\u4ee4\u306e\u3053\u3068<\/em><\/strong>\u3067\u3059\u3002<br>\u95a2\u6570\u306b\u306f<strong><em>2\u7a2e\u985e<\/em><\/strong>\u3042\u308a\u30011\u3064\u76ee\u306f<strong><em>\u72ec\u81ea\u95a2\u6570<\/em><\/strong>\u30012\u3064\u76ee\u306f<strong><em>\u6a19\u6e96\u95a2\u6570\uff08\u7d44\u307f\u8fbc\u307f\u95a2\u6570\uff09<\/em><\/strong>\u3067\u3059\u3002<br><strong>\u72ec\u81ea\u95a2\u6570\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30de\u30fc\u304c\u5909\u6570\u3092\u4f5c\u308b\u306e\u3068\u540c\u3058\u3088\u3046\u306b\u81ea\u7531\u306b\u540d\u524d\u3068\u51e6\u7406\u3092\u8003\u3048\u3001\u30d7\u30ed\u30b0\u30e9\u30de\u30fc\u304c\u4f5c\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/strong><br>\u95a2\u6570\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u52b9\u7387\u7684\u306b\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br><strong>\u6a19\u6e96\u95a2\u6570\u306f\u3001Python\u304c\u6700\u521d\u304b\u3089\u7528\u610f\u3057\u3066\u3042\u308b\u95a2\u6570\u3067\u3059\u3002<\/strong><br>\u6a19\u6e96\u95a2\u6570\u306f\u3001print()\u3084len()\u3001input()\u306a\u3069\u3092\u6307\u3057\u307e\u3059\u3002<br>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u4e16\u754c\u3067\u306f\u3001\u81ea\u7531\u306b\u95a2\u6570\u3092\u5b9a\u7fa9\u3057\u3001\u4f5c\u3063\u305f\u95a2\u6570\u3092\u4f55\u5ea6\u3082\u547c\u3073\u51fa\u3057\u3066\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u308b\u3068\u3044\u3046\u7279\u5fb4\u304c\u3042\u308a\u307e\u3059\u3002<br>\u3053\u306e\u7ae0\u3067\u306f\u4e3b\u306b<strong>\u72ec\u81ea\u95a2\u6570<\/strong>\u306e\u6587\u6cd5\u306b\u91cd\u70b9\u3092\u7f6e\u304d\u3001\u8aac\u660e\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-43\">\u95a2\u6570\u3092\u4f7f\u3046\u30e1\u30ea\u30c3\u30c8\u30fb\u30c7\u30e1\u30ea\u30c3\u30c8<\/h2>\n\n\n\n<p>\u307e\u305a\u3001<strong><em>\u30e1\u30ea\u30c3\u30c8<\/em><\/strong>\u304b\u3089\u8aac\u660e\u3057\u307e\u3059\u3002<br>\u3053\u3053\u3067\u306f\u5927\u304d\u304f2\u3064\u7d39\u4ecb\u3057\u307e\u3059\u3002<br><strong>\uff11\uff09\u30b3\u30fc\u30c9\u304c\u308f\u304b\u308a\u3084\u3059\u304f\u306a\u308b<\/strong><br>\u95a2\u6570\u3092\u4f7f\u3046\u3053\u3068\u306e\u30e1\u30ea\u30c3\u30c8\u3068\u3057\u3066\u3001\u307e\u305a\u30b3\u30fc\u30c9\u304c\u308f\u304b\u308a\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<br>\u5404\u6a5f\u80fd\u3092\u307e\u3068\u3081\u3066\u304a\u304f\u3053\u3068\u3067\u898b\u3084\u3059\u304f\u306a\u308b\u3060\u3051\u3067\u306f\u306a\u304f\u3001\u30c7\u30d0\u30c3\u30b0\u4f5c\u696d\u3082\u52b9\u7387\u826f\u304f\u306a\u308a\u307e\u3059\u3002<br><strong>\uff12\uff09\u95a2\u6570\u3067\u30b3\u30fc\u30c9\u306e\u91cd\u8907\u3092\u6e1b\u3089\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/strong><br>\u30b3\u30fc\u30c9\u306e\u4fdd\u5b88\u6027\u304c\u4e0a\u304c\u308a\u307e\u3059\u3002<br>\u6b21\u306f\u3001<strong><em>\u30c7\u30e1\u30ea\u30c3\u30c8<\/em><\/strong>\u3067\u3059\u304c\u3001\u7d30\u304b\u3044\u8aac\u660e\u3092\u3059\u308b\u3068\u3044\u304f\u3064\u304b\u30d4\u30c3\u30af\u30a2\u30c3\u30d7\u3067\u304d\u307e\u3059\u304c\u3001<br>\u305d\u3053\u307e\u3067\u30c7\u30e1\u30ea\u30c3\u30c8\u3068\u3044\u3046\u30c7\u30e1\u30ea\u30c3\u30c8\u306f\u3042\u307e\u308a\u3042\u3052\u3089\u308c\u307e\u305b\u3093\u3002<br>\u3067\u3059\u306e\u3067\u3001\u7a4d\u6975\u7684\u306b\u95a2\u6570\u3092\u4f5c\u3063\u3066\u4f7f\u3046\u7fd2\u6163\u3092\u4f5c\u3063\u3066\u9802\u3051\u308b\u3068\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u5e45\u3082\u5e83\u304c\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-44\">\u95a2\u6570\u306e\u5b9a\u7fa9<\/h2>\n\n\n\n<p>\u72ec\u81ea\u95a2\u6570\u306e\u8aac\u660e\u3068\u3057\u3066\u3001\u5b9f\u969b\u306b\u95a2\u6570\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<br>\uff08\u203b\u95a2\u6570\u3092\u4f5c\u308b\u3053\u3068\u3092\u95a2\u6570\u3092\u5b9a\u7fa9\u3059\u308b\u306a\u3069\u3068\u8a00\u3044\u307e\u3059\u3002\uff09<br>\u95a2\u6570\u3092\u5b9a\u7fa9\u3059\u308b\u305f\u3081\u306b\u306f\u3001<strong>def<\/strong>\u3068\u3044\u3046\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u6ce8) \u3053\u306e\u30b3\u30fc\u30c9\u306f\u69cb\u6587\u306e\u305f\u3081\u52d5\u4f5c\u3057\u307e\u305b\u3093\u306e\u3067\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\ndef \u95a2\u6570\u540d():\n    # \u30a4\u30f3\u30c7\u30f3\u30c8(\u5b57\u4e0b\u3052\uff09\u3092\u3057\u3063\u304b\u308a\u3059\u308b\u3088\u3046\u306b\uff01\n    # \u51e6\u7406 \n<\/code><\/pre>\n\n\n\n<p>\u305d\u308c\u3067\u306f\u4e0a\u8a18\u57fa\u672c\u69cb\u6587\u3092\u30d9\u30fc\u30b9\u306b\u3001hello!\u3068\u51fa\u529b\u3059\u308b\u3060\u3051\u306e\u95a2\u6570hello\u95a2\u6570\u3092\u4f5c\u3063\u3066\u898b\u307e\u3057\u3087\u3046\u3002<br>hello\u304c\u95a2\u6570\u540d\u3067\u3001\u30a4\u30f3\u30c7\u30f3\u30c8\u3057\u305f\u884c\u304b\u3089\u304c\u3001hello\u95a2\u6570\u306e\u51e6\u7406\u306e\u5b9a\u7fa9\u3092\u8a18\u8ff0\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u30a4\u30f3\u30c7\u30f3\u30c8\u306f\u534a\u89d2\u30b9\u30da\u30fc\u30b94\u3064\u5206\u306e\u3053\u3068\u3067\u3059\u3002\n# \u4ee5\u4e0b\u3001hello()\u95a2\u6570\u3092\u5b9a\u7fa9\u3057\u305f\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u3002\ndef hello():\n    print(\"hello!\")\n<\/code><\/pre>\n\n\n\n<p><strong><em>\u95a2\u6570\u540d\u306f\u5909\u6570\u540d\u3068\u540c\u69d8\u306b\u3001<a href=\"https:\/\/aiacademy.jp\/media\/?id=158&amp;section=%E4%BA%88%E7%B4%84%E8%AA%9E\" target=\"_blank\" rel=\"noreferrer noopener\">\u300c\u4e88\u7d04\u8a9e\u300d<\/a>\u3092\u4f7f\u308f\u306a\u3044\u9650\u308a\u3001\u597d\u304d\u306a\u540d\u524d\u3067\u5b9a\u7fa9\u3067\u304d\u307e\u3059\u3002<\/em><\/strong><br>\u5148\u307b\u3069\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306f\u3001hello\u95a2\u6570\u3092\u5b9a\u7fa9\u3057\u305f\u3060\u3051\u3067\u3059\u306e\u3067\u3001\u547c\u3073\u51fa\u3057\u306f\u3057\u3066\u3044\u307e\u305b\u3093\u3002<br>\u95a2\u6570\u306f\u5b9a\u7fa9\u3057\u305f\u3060\u3051\u3067\u306f\u5b9f\u884c\u3055\u308c\u305a\u3001\u5b9f\u969b\u306b\u547c\u3073\u51fa\u3059\u3053\u3068\u3067\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u95a2\u6570\u3092\u5b9f\u884c\uff08\u547c\u3073\u51fa\u3059\uff09\u306b\u306f\u6b21\u306e\u3088\u3046\u306b<strong>\u95a2\u6570\u540d()<\/strong>\u3068\u3059\u308b\u3053\u3068\u3067\u547c\u3073\u51fa\u305b\u307e\u3059\u3002\u4e0b\u8a18\u306e\u4f8b\u3067\u306f\u3001\u72ec\u81ea\u95a2\u6570hello()\u3092\u5b9a\u7fa9\u3057\u3001\u547c\u3073\u51fa\u3059(\u5b9f\u884c\u3059\u308b)\u306b\u306f<strong>hello()<\/strong>\u3068\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># hello\u95a2\u6570\u306e\u5b9a\u7fa9\ndef hello():\n    print(\"hello!\")\n# \u95a2\u6570\u306e\u547c\u3073\u51fa\u3057(\u5b9f\u884c)\nhello() # hello! \u304c\u51fa\u529b\u3055\u308c\u308b\n<\/code><\/pre>\n\n\n\n<p>\u95a2\u6570\u306e\u5b9a\u7fa9\u3067\u306f\u3001\u3042\u304f\u307e\u3067\u3082\u95a2\u6570\u3092\u5b9a\u7fa9\u3057\u305f\u3060\u3051\u3067\u3059\u306e\u3067\u3001\u51e6\u7406\u306f\u884c\u308f\u308c\u3066\u304a\u308a\u307e\u305b\u3093\u3002<br>\u5b9f\u884c\u3059\u308b\u306b\u306f\u3001<strong>\u95a2\u6570\u540d()<\/strong>\u3068\u3042\u308b\u884c\u3067\u547c\u3073\u51fa\u3057\u51e6\u7406\u304c\u884c\u308f\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-45\">\u95a2\u6570\u540d<\/h2>\n\n\n\n<p>\u95a2\u6570\u540d\u306f\u3001\u958b\u767a\u8005\u304c\u81ea\u7531\u306b\u540d\u524d\u3092\u3064\u3051\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u304c\u3001\u3044\u304f\u3064\u304b\u6ce8\u610f\u70b9\u304c\u3042\u308a\u307e\u3059\u3002<br>\u6ce8\u610f\u70b9\u3068\u3057\u3066\u95a2\u6570\u540d\u3092\u5b9a\u7fa9\u3059\u308b\u969b\u306b\u3001<strong>\u4e88\u7d04\u8a9e\u306a\u3069\u3067\u95a2\u6570\u540d\u3092\u3064\u3051\u306a\u3044\u3053\u3068<\/strong>\u3067\u3059\u3002<br>\u307e\u305f\u3001Python\u3067\u95a2\u6570\u540d\u3092\u72ec\u81ea\u3067\u5b9a\u7fa9\u3059\u308b\u969b\u306b2\u5358\u8a9e\u4ee5\u4e0a\u306e\u95a2\u6570\u540d\u306b\u3059\u308b\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u5c0f\u6587\u5b57\u3067\u4e0b\u7dda(_)\u3092\u631f\u3080\u30b9\u30bf\u30a4\u30eb\u304c\u63a8\u5968\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def lowercase_underscore:\n    print(\"lowercase_underscore\")\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-46\">pass<\/h2>\n\n\n\n<p>\u307e\u305f\u3001\u95a2\u6570\u306f\u3001\u7a7a\u306e\u30ea\u30b9\u30c8\u578b\u3084\u3001\u7a7a\u306e\u8f9e\u66f8\u578b\u3092\u5b9a\u7fa9\u3059\u308b\u3068\u304d\u306e\u3088\u3046\u306b\u3001\u4e2d\u8eab\u306e\u51e6\u7406\u306e\u306a\u3044\u95a2\u6570\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br><strong>\u3068\u308a\u3042\u3048\u305a\u95a2\u6570\u3092\u5ba3\u8a00\u3057\u3066\u304a\u3044\u3066\u3001\u95a2\u6570\u306e\u51e6\u7406\u3068\u3057\u3066\u306f\u4f55\u3082\u3057\u306a\u3044\u6642\u306f\u3001\u300cpass\u300d\u3092\u4f7f\u3044\u307e\u3059\u3002<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u4f55\u3082\u51e6\u7406\u306e\u306a\u3044test\u95a2\u6570\u3092\u5b9a\u7fa9\ndef test():\n    pass\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-47\">\u5f15\u6570<\/h2>\n\n\n\n<p>\u5f15\u6570\u3068\u306f\u3001<strong>\u95a2\u6570\u3092\u547c\u3073\u51fa\u3059\u969b\u306b\u95a2\u6570\u306b\u4e0e\u3048\u308b\u5024\u306e\u3053\u3068<\/strong>\u3067\u3059\u3002<br>\u5927\u304d\u304f2\u7a2e\u985e\u306b\u5206\u3051\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<br><strong>1) \u4eee\u5f15\u6570\uff08\u95a2\u6570\u306e\u5b9a\u7fa9\u5074\u3067\u53d7\u3051\u53d6\u308b\u5024\uff09<\/strong><br><strong>2) \u5b9f\u5f15\u6570\uff08\u95a2\u6570\u306e\u547c\u3073\u51fa\u3057\u5074\u3067\u4e0e\u3048\u308b\u5024\uff09<\/strong><br>\u4ee5\u4e0b\u3001\u5f15\u6570\u3092\u7528\u3044\u305f\u95a2\u6570\u306e\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def say_hello(name):\n    print(\"\u3053\u3093\u306b\u3061\u306f\" + str(name) + \"\u3055\u3093\")\nsay_hello(\"\u5c71\u7530\") # \u3053\u3093\u306b\u3061\u306f\u5c71\u7530\u3055\u3093\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-48\">\u8fd4\u308a\u5024(\u623b\u308a\u5024)<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/camo.qiitausercontent.com\/591f54b285d24b3b59e7d6aa40049b6e485622b5\/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3130353838372f31356365303534612d636536632d633364372d656532652d3366383339353033373435332e706e67\" alt=\"\"><\/figure>\n\n\n\n<p>\u95a2\u6570\u3067\u51e6\u7406\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u547c\u3073\u51fa\u3057\u5143\u306b\u8fd4\u3057\u307e\u3059\u3002<br>\u5f8c\u307b\u3069\u3001\u300c\u5f15\u6570\u3068return\u300d\u306b\u3066\u8a73\u3057\u304f\u898b\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-49\">\u5f15\u6570\u3068return<\/h2>\n\n\n\n<p>\u5148\u307b\u3069\u3001\u8fd4\u308a\u5024(\u623b\u308a\u5024)\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3057\u305f\u304c\u3001return\u6587\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u95a2\u6570\u3092\u7d42\u4e86\u3057\u547c\u3073\u51fa\u3057\u5143\u306b\u623b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>return \u3010\u8fd4\u308a\u5024(\u623b\u308a\u5024)\u3011<\/strong><br>\u5f15\u6570\u3068\u8fd4\u308a\u5024(\u623b\u308a\u5024)\u304c\u3042\u308b\u5834\u5408\u306e\u95a2\u6570\u306e\u66f8\u5f0f\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<br>\u623b\u308a\u5024\u3092\u7701\u7565\u3057\u305f\u5834\u5408\u306f\u3001None\u304c\u8fd4\u308a\u5024(\u623b\u308a\u5024)\u3068\u306a\u308a\u307e\u3059\u3002<br>\u307e\u305f\u3001\u95a2\u6570\u5185\u3067return\u304c\u5b9f\u884c\u3055\u308c\u305f\u5834\u5408\u3082\u3001\u623b\u308a\u5024\u306fNone\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"\"\"\ndef \u95a2\u6570\u540d(\u5f15\u6570):\n    \u51e6\u7406\n    return \u8fd4\u308a\u5024\n\"\"\"\ndef adder(a, b):\n    return a+b\n# \u95a2\u6570\u5185\u90e8\u306e\u51e6\u7406\u3092\u5909\u6570\u306b\u4fdd\u6301\u3057\u3066\u304a\u304d\u305f\u3044\u6642\u306breturn\u306f\u4fbf\u5229\u3067\u3059\u3002\nvalue = adder(5,10) # \u5909\u6570value\u306b15\u304c\u4ee3\u5165\u3055\u308c\u308b\n# \u5148\u307b\u3069\u306elen()\u3092\u7528\u3044\u3066\u8fd4\u308a\u5024\uff08\u623b\u308a\u5024\uff09\u306b\u95a2\u3057\u3066\u8aac\u660e\u3057\u307e\u3059\u3002\n# \u5909\u6570data\u306f\u30011\u301c5\u306e5\u3064\u306e\u8981\u7d20\u3092\u6301\u3063\u305f\u30ea\u30b9\u30c8\u3067\u3059\u3002\ndata = [1,2,3,4,5]\n\"\"\"\n\u95a2\u6570len()\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001\u30ea\u30b9\u30c8\u3067\u3042\u308bdata\u306e\u8981\u7d205\u304c\u8fd4\u308a\u5024\u306b\u306a\u308a\u307e\u3059\u3002\n\u305d\u306e\u8fd4\u308a\u50245\u304c\u5909\u6570value\u306b\u4ee3\u5165\u3055\u308c\u307e\u3059\u3002\n\"\"\"\nvalue = len(data)\nprint(value) # 5\n<\/code><\/pre>\n\n\n\n<p>\u4e0a\u8a18len()\u3092\u56f3\u306b\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u6d41\u308c\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"http:\/\/aiacademy.jp\/assets\/images\/return.png\" alt=\"\"><\/figure>\n\n\n\n<p>\u307e\u305a\u5909\u6570data\u306b[1,2,3,4,5]\u304c\u4ee3\u5165\u3055\u308c\u3001\u30ea\u30b9\u30c8\u3068\u3057\u3066\u5b9a\u7fa9\u3055\u308c\u307e\u3059\u3002<br>\u6b21\u306b\u3001len()\u95a2\u6570\u306b\u3088\u3063\u3066\u30ea\u30b9\u30c8\u3067\u3042\u308bdata\u306e\u8981\u7d20\u306e\u6570\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<br>\u305d\u306e\u53d6\u5f97\u3057\u305f\u7d50\u679c\u304creturn\u306b\u3088\u3063\u3066\u8fd4\u3055\u308c\u3066\u304a\u308a\u3001\u3053\u306e\u8fd4\u3055\u308c\u305f\u5024\u304c\u8fd4\u308a\u5024\u306b\u306a\u308a\u307e\u3059\u3002\u305d\u306e\u5f8c\u3001\u8fd4\u308a\u50245\u304c\u5909\u6570value\u306b\u4ee3\u5165\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-50\">\u306a\u305creturn\u3092\u4f7f\u3046\u306e\u304b<\/h2>\n\n\n\n<p>\u306a\u305cprint()\u3067\u306f\u306a\u304f\u3001return\u3092\u4f7f\u3046\u306e\u304b\u3068\u3044\u3046\u70b9\u304c\u3044\u307e\u3044\u3061\u30d4\u30f3\u3068\u6765\u306a\u3044\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<br>\u3053\u306e\u7bc0\u3067\u306f\u3001\u591a\u304f\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u521d\u5fc3\u8005\u304c\u3064\u307e\u305a\u304d\u3084\u3059\u3044<br><strong>\u306a\u305c\u95a2\u6570\u5185\u3067\u3001print()\u3067\u306f\u306a\u304freturn\u3092\u4f7f\u3046\u306e\u304b\u3068\u3044\u3046\u9055\u3044\u306b\u8aac\u660e\u3057\u307e\u3059\u3002<\/strong><br><strong><em>\u5927\u524d\u63d0\u3068\u3057\u3066\u3001print()\u3068return\u306f\u5168\u304f\u306e\u5225\u7269\u306a\u305f\u3081\u3001\u3057\u3063\u304b\u308a\u4f7f\u3044\u5206\u3051\u304c\u51fa\u6765\u308b\u3088\u3046\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/em><\/strong><br>\u307e\u305a\u30012\u3064\u306e\u9055\u3044\u3068\u3057\u3066\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002<br><strong>return\u306f\u5024\u3092\u8fd4\u3059\u3053\u3068\u304c\u76ee\u7684<\/strong><br><strong>print()\u306f\u5024\u3092\u51fa\u529b\u3059\u308b\u3053\u3068\u76ee\u7684<\/strong><br><strong><em>\u3064\u307e\u308a\u3001return\u3092\u4f7f\u3046\u3068\u3044\u3046\u3053\u3068\u306f\u5024\u3092\u8fd4\u3059\u5fc5\u8981\u304c\u3042\u308b\u6642\u306b\u4f7f\u7528\u3059\u308b<\/em><\/strong>\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<br><strong><em>\u5177\u4f53\u7684\u306breturn\u3092\u4f7f\u3063\u305f\u6b63\u3057\u3044\u4f8b<\/em><\/strong>\u306b\u95a2\u3057\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<br>\u3067\u306f\u3001\u307e\u305a\u4ee5\u4e0b\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u898b\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def adder1(a, b):\n    print(a+b)\ndef adder2(a, b):\n    return a + b\nadder1(2, 4)\nsum = adder2(2, 4)\nprint(sum)\n<\/code><\/pre>\n\n\n\n<p>\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306f\u3001return\u306e\u826f\u3055\u304c\u4f1d\u308f\u308a\u306b\u304f\u304f\u3001\u30e1\u30ea\u30c3\u30c8\u304c\u611f\u3058\u3089\u308c\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br>\u3068\u3044\u3046\u306e\u3082\u3001adder1\u306e\u307b\u3046\u304c\u95a2\u6570\u306e\u547c\u3073\u51fa\u3057\u304c\u65e9\u304f\u51fa\u529b\u3082\u95a2\u6570\u5185\u90e8\u3067\u884c\u3046\u305f\u3081\u3067\u3059\u3002<br>\u3067\u3059\u304c\u4e00\u822c\u7684\u306b\u4f7f\u308f\u308c\u308b\u95a2\u6570\u306e\u4f7f\u3044\u65b9\u306e1\u3064\u306b\u3001\u3042\u308b\u8a08\u7b97\u7d50\u679c\u3092return\u3067\u53d7\u3051\u53d6\u308a\u518d\u5ea6\u5225\u306e\u95a2\u6570\u306b\u305d\u306e\u5024\u3092\u6e21\u3059\u3068\u3044\u3063\u305f\u3053\u3068\u3092\u884c\u3044\u307e\u3059\u3002<br>\u4e0a\u8a18\u65b9\u6cd5\u3067\u306freturn\u306e\u826f\u3055\u304c\u4f1d\u308f\u308a\u307e\u305b\u3093\u3002<br>\u3067\u306f\u3001\u30a4\u30e1\u30fc\u30b8\u3068\u3057\u3066return\u306e\u4f7f\u3044\u65b9\u3068\u3057\u3066\u6b63\u3057\u3044\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u8aac\u660e\u3057\u307e\u3057\u3087\u3046\u3002<br>\u4ee5\u4e0b\u306e\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u8aad\u3093\u3067\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def a(a,b):\n    return a + b\ndef b(a,b):\n    return a * b\nx = a(2,2) # x\u306b4\u304c\u4ee3\u5165\ny = b(x, x)  # 4 * 4\nprint(y) # 16\u304c\u51fa\u529b\n<\/code><\/pre>\n\n\n\n<p>\u95a2\u6570b\u306e\u3088\u3046\u306b\u524d\u306e\u51e6\u7406\u7d50\u679cx\u3092\u307e\u305f\u95a2\u6570b\u306e\u5f15\u6570\u3067\u6e21\u3057\u3066\u3044\u307e\u3059\u3002<br>\u3053\u306e\u3088\u3046\u306b\u3001return\u3092\u884c\u3046\u3053\u3068\u3067\u8a08\u7b97\u7d50\u679c\u3092\u4e00\u65e6\u5909\u6570\u306b\u683c\u7d0d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001<br>\u3055\u3089\u306b\u305d\u306e\u5024\u3092\u5225\u306e\u95a2\u6570\u306b\u6e21\u3057\u3066\u9055\u3046\u51e6\u7406\u306b\u7e4b\u3052\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<br>\u307e\u305f\u3001\u95a2\u6570\u306b\u6e21\u3059\u3068\u3044\u3046\u306e\u306freturn\u3092\u4f7f\u3046\u4e00\u4f8b\u3067\u3059\u304c\u3001<strong><em>\u95a2\u6570\u306b\u6e21\u3055\u305a\u3068\u3082\u8fd4\u308a\u5024(\u623b\u308a\u5024)\u306b\u5bfe\u3057\u3066\u66f4\u306b\u4f55\u304b\u3057\u3089\u306e\u51e6\u7406\u3092\u884c\u3046\u3053\u3068\u304c\u51fa\u6765\u308b\u3068\u3044\u3046\u3053\u3068\u304c\u30dd\u30a4\u30f3\u30c8\u306b\u306a\u308a\u307e\u3059\u3002<\/em><\/strong>\u95a2\u6570\u5185\u90e8\u3067\u51fa\u529b\uff08print\uff09\u3059\u308b\u3060\u3051\u3067\u3042\u308c\u3070print()\u3067\u51fa\u529b\u3059\u308c\u3070\u826f\u3044\u3067\u3059\u304c\u3001\u5185\u90e8\u306bprint\u95a2\u6570\u304c\u7121\u3044\u95a2\u6570\u306f\u3001\u51e6\u7406\u3057\u305f\u7d50\u679c\u3092return(\u8fd4\u308a\u5024\/\u623b\u308a\u5024)\u3067\u53d7\u3051\u53d6\u308a\u3001<br>\u305d\u306e\u5024\u3092\u5909\u6570\u306b\u4ee3\u5165\u3057\u3001\u307e\u305f\u4ed6\u306e\u95a2\u6570\u306b\u305d\u306e\u8fd4\u308a\u5024\u3092\u6e21\u3059\u3053\u3068\u3067\u518d\u5ea6\u5225\u306e\u51e6\u7406\u306b\u3064\u306a\u3052\u308b\u4e8b\u304c\u51fa\u6765\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br>\u524d\u8ff0\u306e\u901a\u308a\u3001<strong><em>return\u306f\u5024\u3092\u8fd4\u3059\u3053\u3068\u304c\u76ee\u7684<\/em><\/strong>\u3068\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u95a2\u6570\u5185\u90e8\u306e\u51e6\u7406\u3092\u3001\u95a2\u6570\u5185\u90e8\u306e\u51e6\u7406\u4ee5\u964d\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3082\u3001\u8fd4\u308a\u5024\u3068\u3057\u3066\u53d7\u3051\u53d6\u3063\u305f\u5024\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u524d\u63d0\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-51\">return\u3092\u5229\u7528\u3057\u305f\u95a2\u6570\u306e\u30b5\u30f3\u30d7\u30eb<\/h2>\n\n\n\n<p>\u305d\u308c\u3067\u306f\u3001\u95a2\u6570\u5185\u90e8\u306bprint()\u3092\u4f7f\u308f\u305areturn\u3092\u4f7f\u3063\u305f\u95a2\u6570\u3092\u30b5\u30f3\u30d7\u30eb\u3068\u3057\u3066\u307f\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def power(x):\n    return x*x\ndef absolute(x):\n    if (x &lt; 0):\n        return -x\n    else:\n        return x\nprint(power(10)) # 100\nprint(absolute(-10)) # 10\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-52\">\u5f15\u6570\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u5024<\/h2>\n\n\n\n<p>\u95a2\u6570\u3067\u306f\u3001\u5f15\u6570\u3092\u6307\u5b9a\u3057\u306a\u304b\u3063\u305f\u5834\u5408\u306b\u5f15\u6570\u3092\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def func(a, b=5):\n    print(a)\n    print(b)\nfunc(10,15) # 10\u306815\u304c\u51fa\u529b\u3055\u308c\u308b\nfunc(3) # 3\u30685\u304c\u51fa\u529b\u3055\u308c\u308b\n<\/code><\/pre>\n\n\n\n<p>\u3053\u3053\u3067\u3001\u4e0a\u8a18\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3001b=5\u3068\u306a\u3063\u3066\u304a\u308a\u307e\u3059\u304c\u3001\u3053\u308c\u304c\u5f15\u6570\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3067\u3059\u3002<br>\u5f15\u6570\u306b\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<br>\u3053\u306e\u95a2\u6570\u306f\u6574\u6570\u5024\u306e\u5f15\u6570\u30922\u3064\u4e0e\u3048\u308b\u3053\u3068\u3067\u3001\u305d\u306e2\u3064\u3092\u51fa\u529b\u3059\u308b\u3060\u3051\u306e\u95a2\u6570\u3067\u3059\u304c\u3001<br>\u3082\u3057\u5f15\u6570\u30921\u3064\u3057\u304b\u6e21\u3055\u306a\u304b\u3063\u305f\u5834\u5408\u306f\u30012\u3064\u76ee\u306e\u5024\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u5024b\u304c5\u3068\u306a\u3063\u3066\u3044\u308b\u305f\u3081\u306b\u30015\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3055\u3066\u3001\u4e0b\u8a18\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u95a2\u3057\u3066\u8003\u3048\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br>\u4e0b\u8a18\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001[\u2018python\u2019, \u2018Python\u2019]\u304c\u6700\u5f8c\u306e\u95a2\u6570\u547c\u3073\u51fa\u3057\u3067\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def sample(arg, arg_list=[]):\n    arg_list.append(arg)\n    print(arg_list)\nsample('python')\nsample('Python')\n<\/code><\/pre>\n\n\n\n<p>Q. \u3053\u306e\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u969b\u306b\u3001\u6bce\u56de\u5f15\u6570\u306b\u6e21\u3057\u305f\u8981\u7d20\u3060\u3051\u3092\u8fd4\u3059\u3088\u3046\u306b\u3057\u305f\u3044\u3067\u3059\u3002<br>\u5b9f\u969b\u306b\u4fee\u6b63\u3059\u308b\u306b\u306f\u3069\u3046\u3059\u308c\u3070\u826f\u3044\u3067\u3057\u3087\u3046\u304b\uff1f\uff1f<\/p>\n\n\n\n<p>A. \u3053\u306e\u5834\u5408\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u4fee\u6b63\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def sample(arg):\n    arg_list = [] # \u30ea\u30b9\u30c8\u306e\u521d\u671f\u5316\n    arg_list.append(arg)\n    print(arg_list)\nsample('python') # ['python']\nsample('Python') # ['Python']\n<\/code><\/pre>\n\n\n\n<p>\u4e0a\u8a18\u306f\u3001\u6bce\u56de\u30ea\u30b9\u30c8\u3092\u521d\u671f\u5316\u3057\u3066\u3044\u307e\u3059\u3002<br>\u305d\u306e\u5f8c\u306b\u3001\u5f15\u6570\u3067\u6e21\u3055\u308c\u305farg\u3092\u521d\u671f\u5316\u3057\u305f\u7a7a\u306e\u30ea\u30b9\u30c8\u306bappend\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-53\">\u95a2\u6570 \u5909\u6570\u306e\u30b9\u30b3\u30fc\u30d7<\/h2>\n\n\n\n<p>\u30b9\u30b3\u30fc\u30d7\u306f\u304b\u306a\u308a\u91cd\u8981\u306a\u90e8\u5206\u306b\u306a\u308a\u307e\u3059\u3002<br>\u4eca\u5f8c\u3001\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u3057\u3066\u3044\u304f\u4e0a\u3067\u3001\u5927\u4e8b\u306a\u8003\u3048\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u3057\u3063\u304b\u308a\u62bc\u3055\u3048\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<br><strong>\u30dd\u30a4\u30f3\u30c8\u306f\u3001\u5909\u6570\u306f\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<\/strong><\/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>def 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)\nadd(5) # 5 + 10\u306715\u304c\u51fa\u529b\n<\/code><\/pre>\n\n\n\n<p>\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>def 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)\nadd(5) # 5 + 10\u306715\u304c\u51fa\u529b\nprint(x2) # \u3053\u3053\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\n<\/code><\/pre>\n\n\n\n<p>\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001<strong>NameError: name \u2018x2\u2019 is not defined<\/strong>\u3068\u3044\u3046\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002<br><strong>\u3053\u308c\u306f\u95a2\u6570\u5185\u3067\u5b9a\u7fa9\u3057\u305f\u5909\u6570x2\u306f\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u3067\u3042\u308a\u3001\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u304b\u95a2\u6570\u5185\u90e8\u3060\u3051\u3057\u304b\u6709\u52b9\u3067\u306f\u306a\u3044\u305f\u3081\u3001\u95a2\u6570\u306e\u5916\u5074\u3067x2\u3092\u547c\u3073\u51fa\u3059\u3068\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/strong><\/p>\n\n\n\n<p>\u6709\u52b9\u306a\u89e3\u6c7a\u624b\u6bb5\u3068\u3057\u3066\u95a2\u6570\u306e\u5916\u306bx2\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3067\u3059\u3002<br>(\u203b\u5909\u6570\u306e\u30b9\u30b3\u30fc\u30d7\u4ee5\u5916\u306b\u3082\u3001\u95a2\u6570\u5185\u90e8\u51e6\u7406\u306a\u3069\u3082\u308f\u304b\u308a\u3084\u3059\u3044\u3088\u3046\u3001\u4fee\u6b63\u3057\u3066\u3044\u307e\u3059\u3002)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def add(x1,x2):\n    result = x1 + x2\n    return result\nx1 = 5\nx2 = 10\nresult = add(x1, x2) # 5 + 10\u306715\u304c\u51fa\u529b\nprint(result)\n<\/code><\/pre>\n\n\n\n<p>\u4ed6\u306b\u3082\u3001<strong>global\u3092\u5229\u7528\u3057\u3066\u95a2\u6570\u5185\u3067\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570<\/strong>\u3092\u5229\u7528\u3059\u308b\u304b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-54\">\u30b0\u30ed\u30fc\u30d0\u30eb(global)\u5ba3\u8a00\u30fb\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570<\/h2>\n\n\n\n<p>\u95a2\u6570\u5185\u3067\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306e\u5ba3\u8a00\u3067\u3059\u3002<br>\u30ed\u30fc\u30ab\u30eb\u5909\u6570\uff08\u95a2\u6570\u5b9a\u7fa9\u306e\u5185\u90e8\u3067\u5b9a\u7fa9\u3057\u305f\u95a2\u6570\uff09\u3068\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\uff08\u95a2\u6570\u5b9a\u7fa9\u306e\u5916\u5074\u3067\u5b9a\u7fa9\u3057\u305f\u5909\u6570\uff09\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>glb = 0\ndef func1():\n    glb = 1\ndef func2():\n    global glb\n    glb = 5\nprint(glb) # 0\u304c\u51fa\u529b\u3055\u308c\u308b\nfunc1()\nprint(glb) # 0\u304c\u51fa\u529b\u3055\u308c\u308b\nfunc2()\nprint(glb) # 5\u304c\u51fa\u529b\u3055\u308c\u308b\n<\/code><\/pre>\n\n\n\n<p>\u3082\u3046\u4e00\u3064\u4f8b\u984c\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>var1 = '\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570'\ndef sample():\n    var2 = '\u30ed\u30fc\u30ab\u30eb\u5909\u6570'\n    return (var1, var2)\nprint(sample())\n<\/code><\/pre>\n\n\n\n<p>\u4e0a\u8a18\u306e\u4f8b\u306f\u3001\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u3068\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u3092\u305d\u308c\u305e\u308c\u5ba3\u8a00\u3057\u3066\u3044\u307e\u3059\u3002<br>\u6b21\u306e\u30b5\u30f3\u30d7\u30eb\u306f\u3001\u95a2\u6570\u5185\u304b\u3089\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u3092\u5909\u66f4\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>var1 = '\u30b0\u30ed\u30fc\u30d0\u30eb'\ndef sample():\n    global var1\n    var1 = '\u30ed\u30fc\u30ab\u30eb\u306b\u5909\u66f4\u3055\u308c\u307e\u3057\u305f'\nsample()    # \u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570var1\u3092\u95a2\u6570\u5185\u90e8\u3067\u5909\u66f4\nprint(var1) # \u30ed\u30fc\u30ab\u30eb\u306b\u5909\u66f4\u3055\u308c\u307e\u3057\u305f\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-55\">\u304a\u307f\u304f\u3058\u30a2\u30d7\u30ea\u3092\u4f5c\u308b\u524d\u306b<\/h3>\n\n\n\n<p>\u304a\u597d\u304d\u306a\u30c6\u30ad\u30b9\u30c8\u30a8\u30c7\u30a3\u30bf\u3068\u30bf\u30fc\u30df\u30ca\u30eb(\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8)\u3092\u5143\u306b\u3001\u81ea\u4f5c\u3057\u305f\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u8aad\u307f\u8fbc\u307f\u5229\u7528\u3057\u3066\u3044\u304d\u307e\u3059\u3002<br>\u305d\u306e\u305f\u3081\u3001Jupyter Notebook\u3084Google Colab\u306e\u5834\u5408\u3001\u3053\u306e\u7ae0\u306b\u66f8\u304b\u308c\u3066\u3044\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3060\u3068\u52d5\u4f5c\u3057\u306a\u3044\u305f\u3081\u3001\u6b21\u306e\u6d41\u308c\u3067\u8a66\u3057\u3066\u898b\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>\u307e\u305f\u3001\u4e0b\u8a18\u30ea\u30f3\u30af\u304b\u3089Colab\u4e0a\u3067\u52d5\u4f5c\u3059\u308b\u65b9\u6cd5\u3082\u3042\u3052\u3066\u3044\u307e\u3059\u306e\u3067\u78ba\u8a8d\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br><a href=\"https:\/\/youtu.be\/gJS1krnczxE\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">YouTube\u52d5\u753b \/ Colab\u306b\u3066\u52d5\u4f5c\u3055\u305b\u308b<\/a><\/p>\n\n\n\n<p>1) \u304a\u624b\u5143\u306ePC\u3067fortune.py\u3092\u4f5c\u6210\u3002<br>\u6b21\u306b\u3001Colab\u306e\u5de6\u30e1\u30cb\u30e5\u30fc(&gt;\u3092\u62bc\u3057\u307e\u3059)\u304b\u3089\u3001\u76ee\u6b21\u3001\u30b3\u30fc\u30c9\u30b9\u30cb\u30da\u30c3\u30c8\u3001\u30d5\u30a1\u30a4\u30eb\u306e3\u3064\u304c\u8868\u793a\u3055\u308c\u3001\u305d\u306e\u4e2d\u306e\u30d5\u30a1\u30a4\u30eb\u30bf\u30d6\u3092\u9078\u629e\u3059\u308b\u3002<\/p>\n\n\n\n<p>2) 1\u3067\u958b\u3044\u305f\u30bf\u30d6\u304b\u3089\u3001\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3092\u62bc\u3059\u3068\u3001\u624b\u5143\u306ePC\u3067\u4f5c\u6210\u3057\u305ffortune.py\u3092\u9078\u629e\u51fa\u6765\u308b\u306e\u3067\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u3002<\/p>\n\n\n\n<p><strong>fortune.py<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def get_fortune():\n    import random # randam\u3067\u306f\u306a\u304f\u3001random\u306a\u306e\u3067\u6ce8\u610f\u3067\u3059\n    results = ['\u5927\u5409', '\u5409', '\u5c0f\u5409', '\u51f6', '\u5927\u51f6', '\u672b\u5409']\n    return random.choice(results)\n<\/code><\/pre>\n\n\n\n<p>3) \u305d\u306e\u5f8cColab\u5074\u3067\u6b21\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import fortune\nresult = fortune.get_fortune()\nprint(\"\u4eca\u65e5\u306e\u904b\u52e2\u306f\uff0e\uff0e\uff0e\", result)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-56\">\u30e9\u30a4\u30d6\u30e9\u30ea<\/h2>\n\n\n\n<p><strong>\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u306f\u3001\u3042\u308b\u7a0b\u5ea6\u307e\u3068\u307e\u3063\u305f\u6c4e\u7528\u6027\u306e\u9ad8\u3044\u51e6\u7406\uff08\u95a2\u6570\u30fb\u30af\u30e9\u30b9\u30fb\u305d\u306e\u4ed6\uff09\u3092\u4ed6\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u304b\u3089\u8aad\u307f\u8fbc\u3080\u3053\u3068\u3067\u3001\u4f7f\u3046\u3053\u3068\u304c\u51fa\u6765\u308b\u3088\u3046\u306b\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<\/strong><br>Python\u5185\u3067\u306f\u57fa\u672c\u7684\u306bimport\u3067\u304d\u308b\u3082\u306e\u3092\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u547c\u3093\u3060\u308a\u3057\u307e\u3059\u3002<br>\u306a\u304a\u3001\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u4e00\u822c\u7684\u306a\u547c\u3073\u540d\u3067\u3042\u308a\u3001Python\u3067\u306f\u3001\u57fa\u672c\u7684\u306b\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u3044\u3046\u8868\u8a18\u304c\u3042\u3063\u305f\u3089\u3001\u4e0b\u8a18\u3067\u8aac\u660e\u3059\u308b\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u3053\u3068\u3060\u3068\u601d\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-57\">\u30e2\u30b8\u30e5\u30fc\u30eb\u3068\u30d1\u30c3\u30b1\u30fc\u30b8<\/h2>\n\n\n\n<p><strong><em>\u30e2\u30b8\u30e5\u30fc\u30eb\u306fPython\u306e\u30b3\u30fc\u30c9\u3092\u307e\u3068\u3081\u305f\u30d5\u30a1\u30a4\u30eb\u3067\u3042\u308a\u3001\u4ed6\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u304b\u3089\u518d\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u3053\u3068\u3092\u300c\u30e2\u30b8\u30e5\u30fc\u30eb\uff63\u3068\u8a00\u3044\u307e\u3059\u3002<\/em><\/strong><br>\u305d\u308c\u5358\u4f53\u3067\u306f\u52d5\u4f5c\u3057\u307e\u305b\u3093\u304c\u3001import\u3059\u308b\u3053\u3068\u3067\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br><strong><em>\u30d1\u30c3\u30b1\u30fc\u30b8\u3068\u306f__init__.py\u3068\u8907\u6570\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u96c6\u307e\u3063\u305f\u3082\u306e\u3067\u3059\u3002<\/em><\/strong><br>__init__.py\u306f\u30d1\u30c3\u30b1\u30fc\u30b8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u7f6e\u304b\u308c\u3001\u305d\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u305f\u969b\u306b\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-58\">\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30dd\u30fc\u30c8<\/h2>\n\n\n\n<p>import\u6587\u306e\u5358\u7d14\u306a\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br><strong>import \u8aad\u307f\u8fbc\u307f\u305f\u3044\u30e2\u30b8\u30e5\u30fc\u30eb<\/strong><br>\u8aad\u307f\u8fbc\u307f\u305f\u3044\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u90e8\u5206\u306f\u3001\u4ed6\u306ePython\u30d5\u30a1\u30a4\u30eb\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u304b\u3089\u62e1\u5f35\u5b50\u306e.py\u3092\u53d6\u308a\u9664\u3044\u305f\u3082\u306e\u3067\u3059\u3002<br>\u4f8b\u3048\u3070\u3001sys\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u8aad\u307f\u8fbc\u307f\u305f\u3044\u6642\u306f\u6b21\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<br>(sys\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3001Python\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u6bb5\u968e\u3067\u5229\u7528\u3067\u304d\u308b\u30e2\u30b8\u30e5\u30fc\u30eb\u306e1\u3064\u3067\u3059\u3002\u3053\u308c\u3092<strong>\u6a19\u6e96\u30e2\u30b8\u30e5\u30fc\u30eb<\/strong>\u3068\u547c\u3073\u3001\u4ed6\u306b\u3082os\u30e2\u30b8\u30e5\u30fc\u30eb\u306a\u3069\u69d8\u3005\u3042\u308a\u307e\u3059\u3002)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import sys\n<\/code><\/pre>\n\n\n\n<p>\u8907\u6570\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u5834\u5408\u3001\u300c,\u300d\u3067\u30e2\u30b8\u30e5\u30fc\u30eb\u540d\u3092\u533a\u5207\u3063\u3066\u30a4\u30f3\u30dd\u30fc\u30c8\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import sys, os\n<\/code><\/pre>\n\n\n\n<p>\u4f8b\u3048\u3070math\u30e2\u30b8\u30e5\u30fc\u30eb\u306ecos\u95a2\u6570\u3092\u5229\u7528\u3057\u305f\u3044\u5834\u5408\u306f<strong>\u30e2\u30b8\u30e5\u30fc\u30eb\u540d.\u95a2\u6570\u540d(\u5f15\u6570\uff09<\/strong>\u3067\u5229\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import math\nmath.cos(1) # 0.5403023058681398\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-59\">\u72ec\u81ea\u3067\u4f5c\u6210\u3057\u305f\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b<\/h2>\n\n\n\n<p>\u4eca\u56de\u306f\u904b\u52e2\u30d7\u30ed\u30b0\u30e9\u30e0(\u5360\u3044\u30e2\u30b8\u30e5\u30fc\u30eb)\u3092\u4f5c\u308a\u307e\u3059\u3002<br>\u307e\u305amain\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br>\uff08\u30d5\u30a1\u30a4\u30eb\u540d\u306f\u81ea\u7531\u3067\u3059\u304c\u3053\u3053\u3067\u306fmain.py\u3068\u3057\u307e\u3059\u3002\uff09<\/p>\n\n\n\n<p><strong>main.py<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import fortune\nresult = fortune.get_fortune()\nprint(\"\u4eca\u65e5\u306e\u904b\u52e2\u306f... \", result)\n<\/code><\/pre>\n\n\n\n<p>\u3067\u306f\u6b21\u306bfortune\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<br>\u4e0b\u8a18\u30d7\u30ed\u30b0\u30e9\u30e0\u3092<strong>fortune.py<\/strong>\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u540d\u3067\u4e0a\u306e\u4f5c\u6210\u3057\u305fmain\u30d7\u30ed\u30b0\u30e9\u30e0(main.py)\u3068\u540c\u3058\u5834\u6240\u306b\u4fdd\u5b58\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p><strong>fortune.py<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def get_fortune():\n    import random # randam\u3067\u306f\u306a\u304f\u3001random\u306a\u306e\u3067\u6ce8\u610f\u3067\u3059\n    results = ['\u5927\u5409', '\u5409', '\u5c0f\u5409', '\u51f6', '\u5927\u51f6', '\u672b\u5409']\n    return random.choice(results)\n<\/code><\/pre>\n\n\n\n<p>\u305d\u308c\u3067\u306f\u3001main.py\u3068fortune.py\u3092\u540c\u3058\u30d5\u30a9\u30eb\u30c0\u306b\u4fdd\u5b58\u3057\u3066\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u3001\u4f5c\u6210\u3057\u305fmain.py\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br>\u5b9f\u884c\u3059\u308b\u306b\u306f\u3001Mac\u3092\u304a\u4f7f\u3044\u306e\u65b9\u306f\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u3001Windows\u306e\u65b9\u306f\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u304b\u3089\u3001\u4fdd\u5b58\u3055\u308c\u305fmain.py\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python main.py\n<\/code><\/pre>\n\n\n\n<p><strong><em>\u4e0a\u8a18\u3092\u5b9f\u884c\u3059\u308b\u969b\u306b\u3001\u305d\u306e\u307e\u307e\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u8d77\u52d5\u3057\u3066\u4e0a\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u5834\u5408\u306b\u3001(null): can\u2019t open file \u2018main.py\u2019: [Errno 2] No such file or directory\u3068\u3044\u3046\u30a8\u30e9\u30fc\u304c\u3067\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<\/em><\/strong><br>\u3053\u308c\u306f\u3001main.py\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4eca\u3044\u308b\u968e\u5c64\u306b\u5b58\u5728\u3057\u306a\u3044\u305f\u3081\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u5b9f\u884c\u3059\u308b\u5ea6\u306b\u3001\u51fa\u529b\u7d50\u679c\u304c\u5909\u308f\u308c\u3070\u554f\u984c\u306a\u304f\u52d5\u4f5c\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-60\">from\u3068import<\/h2>\n\n\n\n<p><strong><em>from \u30d5\u30a1\u30a4\u30eb\u540d(\u30e2\u30b8\u30e5\u30fc\u30eb\u540d) import *<\/em><\/strong>\u3067\u30d5\u30a1\u30a4\u30eb\u540d\u306e\u6307\u5b9a\u306a\u3057\u306b\u547c\u3073\u51fa\u3057\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from \u30e2\u30b8\u30e5\u30fc\u30eb\u540d import *\n<\/code><\/pre>\n\n\n\n<p>\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u95a2\u6570\u306a\u3069\u3092\u5229\u7528\u3059\u308b\u969b\u306b\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u540d.\u306e\u8a18\u8ff0\u3092\u7701\u7565\u3057\u3066\u95a2\u6570\u540d\u3060\u3051\u3067\u4f7f\u7528\u3057\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from \u30e2\u30b8\u30e5\u30fc\u30eb\u540d import \u95a2\u6570\u540d, \u95a2\u6570\u540d, ...\n<\/code><\/pre>\n\n\n\n<p>\u4e0a\u8a18\u306e\u69cb\u6587\u3092\u5143\u306b\u6b21\u306e\u3088\u3046\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304f\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from math import cos, sin, tan\ncos(1)\n<\/code><\/pre>\n\n\n\n<p>\u5148\u307b\u3069\u3001fortune.py\u3067random.choice(results)\u3068\u8a18\u8ff0\u3057\u307e\u3057\u305f\u304c\u3001<br>fortune.py\u306ffrom\u3092\u4f7f\u3044\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304d\u63db\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def get_fortune():\n    from random import choice\n    results = ['\u5927\u5409', '\u5409', '\u5c0f\u5409', '\u51f6', '\u5927\u51f6', '\u672b\u5409']\n    return choice(results)\n<\/code><\/pre>\n\n\n\n<p>\u307e\u305f\u3001\u540d\u524d\u3092\u6307\u5b9a\u305b\u305a\u306b\u30e2\u30b8\u30e5\u30fc\u30eb\u5185\u306e\u3059\u3079\u3066\u306e\u30e1\u30f3\u30d0(\u95a2\u6570\u3001\u5b9a\u6570\u3001\u30af\u30e9\u30b9\u306a\u3069\u306e\u3053\u3068)\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># from \u30e2\u30b8\u30e5\u30fc\u30eb\u540d import *\nfrom math import *\ncos(1)\nsin(1)\n<\/code><\/pre>\n\n\n\n<p>fortune.py\u3067random\u3092\u30b5\u30f3\u30d7\u30eb\u3067import\u3057\u3066\u3044\u308b\u306e\u306f\u95a2\u6570\u5185\u3067\u3059\u304c\u3001<br>\u95a2\u6570\u5916\u3067\u3082\u30a4\u30f3\u30dd\u30fc\u30c8\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from random import *\ndef get_fortune():\n    results = ['\u5927\u5409', '\u5409', '\u5c0f\u5409', '\u51f6', '\u5927\u51f6', '\u672b\u5409']\n    return choice(results)\nprint(get_fortune())\nsin(1)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-61\">\u5225\u540d\u3067\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30dd\u30fc\u30c8<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code># main.py\nimport fortune\nresult = fortune.get_fortune()\nprint(\"\u4eca\u65e5\u306e\u904b\u52e2\u306f... \", result)\n<\/code><\/pre>\n\n\n\n<p>import fortune\u3068\u8a18\u8ff0\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001as\u3092\u7528\u3044\u308b\u3053\u3068\u3067\u3001\u5225\u540d\u3092\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br>\u4ee5\u4e0b\u304c\u5225\u540d\u3092\u3064\u3051\u305f\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import fortune as ft\nresult = ft.get_fortune()\nprint(\"\u4eca\u65e5\u306e\u904b\u52e2\u306f... \", result)\n<\/code><\/pre>\n\n\n\n<p>\u5225\u540d\u3092\u3064\u3051\u305f\u3053\u3068\u3067ft.get_fortune()\u3068\u547c\u3073\u51fa\u3059\u3053\u3068\u304c\u51fa\u6765\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-62\">\u5fc5\u8981\u306a\u3082\u306e\u3060\u3051\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b<\/h2>\n\n\n\n<p>*\u3067\u5168\u3066\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u307e\u3057\u305f\u304c\u3001\u5fc5\u8981\u306a\u90e8\u54c1\u3060\u3051\u3082\u30a4\u30f3\u30dd\u30fc\u30c8\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from fortune import get_fortune\nresult = get_fortune()\nprint(\"\u4eca\u65e5\u306e\u904b\u52e2\u306f... \", result)\n<\/code><\/pre>\n\n\n\n<p>\u307e\u305f\u5225\u540d\u3092\u3064\u3051\u3001\u304b\u3064get_fortune\u3060\u3051\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from fortune import get_fortune as gf\nresult = gf()\nprint(\"\u4eca\u65e5\u306e\u904b\u52e2\u306f... \", result)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-63\">\u30e9\u30a4\u30d6\u30e9\u30ea\u30fb\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5834\u6240\u3092\u8abf\u3079\u308b<\/h2>\n\n\n\n<p><strong>\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u5834\u6240\u306f\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u306e&nbsp;file&nbsp;\u30a2\u30c8\u30ea\u30d3\u30e5\u30fc\u30c8\u304b&nbsp;path&nbsp;\u30a2\u30c8\u30ea\u30d3\u30e5\u30fc\u30c8\u3067\u8abf\u3079\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/strong><br>\u4f8b\u3048\u3070\u6b21\u306e\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3067\u8abf\u3079\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import os\nprint( os.__file__ ) # \/Users\/aiacademy\/anaconda3\/lib\/python3.6\/os.py\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-64\">\u304a\u307f\u304f\u3058\u30a2\u30d7\u30ea\u3092\u5b9f\u884c\u3057\u3066\u307f\u308b\u3002<\/h2>\n\n\n\n<p>Mac\u306e\u65b9\u306f\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u3001Windows\u306e\u65b9\u306f\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u8d77\u52d5\u3057\u3001\u5148\u307b\u3069\u4f5c\u6210\u3057\u305fmain.py\u3092\u6b21\u306emain.py\u304c\u3042\u308b\u30d5\u30a9\u30eb\u30c0\u306b\u79fb\u52d5\u3057\u3001\u5b9f\u884c\u3057\u3066\u898b\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python main.py\n<\/code><\/pre>\n\n\n\n<p>\u5b9f\u884c\u3059\u308b\u3068\u3001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u4eca\u65e5\u306e\u904b\u52e2\u306f... \u25cb\u25cb\u3067\u3059\u3002\n<\/code><\/pre>\n\n\n\n<p>\u3068\u3044\u3046\u3088\u3046\u306b\u3001\u25cb\u25cb\u306b\u306f\u3001\u30e9\u30f3\u30c0\u30e0\u3067\u5b9f\u884c\u6bce\u306b\u904b\u52e2\u306e\u7d50\u679c\u304c\u5909\u308f\u3063\u3066\u3044\u308b\u306e\u304c\u308f\u304b\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<br>\u3082\u3057\u3053\u306e\u7ae0\u3067\u304a\u307f\u304f\u3058\u30a2\u30d7\u30ea\u304c\u5b9f\u884c\u3067\u304d\u306a\u304b\u3063\u305f\u5834\u5408\u306f\u4e0b\u8a18\u30c6\u30ad\u30b9\u30c8\u3092\u3054\u53c2\u8003\u304f\u3060\u3055\u3044\u3002<br><a href=\"https:\/\/aiacademy.jp\/media\/?id=193\" target=\"_blank\" rel=\"noreferrer noopener\">\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3067\u52d5\u4f5c\u3059\u308b\u304a\u307f\u304f\u3058\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046\uff01<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-65\">\u306f\u3058\u3081\u306b<\/h2>\n\n\n\n<p>Python\u306f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u8a00\u8a9e\u3068\u547c\u3070\u308c\u3066\u304a\u308a\u307e\u3059\u3002<br>\u3053\u306e\u7ae0\u3067\u306f\u3053\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u8a00\u8a9e\u306e\u7406\u89e3\u306b\u306f\u6b20\u304b\u305b\u306a\u3044\u3001<strong>\u300e\u30af\u30e9\u30b9\u300f<\/strong>\u306e\u57fa\u672c\u306b\u95a2\u3057\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<br>Python\u306b\u9650\u3089\u305a\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u8a00\u8a9e\u306b\u306f\u3001\u30af\u30e9\u30b9\u3092\u4f7f\u3046\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<br><strong><em>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u306f\u7406\u89e3\u304c\u3057\u306b\u304f\u3044\u3082\u306e\u3067\u3059\u306e\u3067\u3001<br>\u3053\u306e\u30c6\u30ad\u30b9\u30c8\u3060\u3051\u3067\u5168\u3066\u3092\u7406\u89e3\u3057\u3088\u3046\u3068\u305b\u305a\u3001\u3053\u3046\u3044\u3046\u3082\u306e\u306a\u3093\u3060\u306a\u3068\u3044\u3046\u7a0b\u5ea6\u306e\u7406\u89e3\u3067\u69cb\u3044\u307e\u305b\u3093\u306e\u3067\u3001\u81ea\u5206\u306e\u30da\u30fc\u30b9\u3067\u5b66\u7fd2\u3092\u7d9a\u3051\u3066\u304f\u3060\u3055\u3044\u3002<\/em><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-66\">\u91cd\u8981\u306a\u7528\u8a9e<\/h2>\n\n\n\n<p>\u4eca\u56de\u3053\u306e\u7ae0\u306e\u4e2d\u3067\u306f\u3001\u4ee5\u4e0b\u306e<strong><em>10\u3064\u306e\u91cd\u8981\u306a\u7528\u8a9e<\/em><\/strong>\u304c\u767b\u5834\u3057\u307e\u3059\u3002<br>\u3053\u308c\u3089\u306f\u3001Python\u306b\u9650\u3089\u305a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u8a00\u8a9e(Java\u306a\u3069\uff09\u306b\u306f\u5168\u3066\u6301\u3061\u5408\u308f\u305b\u3066\u3044\u307e\u3059\u3002<br>\u7528\u8a9e\u306e\u610f\u5473\u304c\u308f\u304b\u3089\u306a\u304f\u306a\u3063\u305f\u3089\u30011\u30641\u3064\u305d\u308c\u3092\u8aac\u660e\u3057\u3066\u3044\u308b\u30bb\u30af\u30b7\u30e7\u30f3\u306b\u623b\u308a\u3001\u5fa9\u7fd2\u3092\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p><strong>1.\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411<\/strong><br><strong>2.\u30af\u30e9\u30b9<\/strong><br><strong>3.\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><br><strong>4.\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf<\/strong><br><strong>5.\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9<\/strong><br><strong>6.\u30e1\u30bd\u30c3\u30c9<\/strong><br><strong>7.\u7d99\u627f<\/strong><br><strong>8.\u591a\u91cd\u7d99\u627f<\/strong><br><strong>9.\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9<\/strong><br><strong>10.\u89aa\u30af\u30e9\u30b9\u3068\u5b50\u30af\u30e9\u30b9<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-67\">\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411<\/h2>\n\n\n\n<p><strong>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u3068\u306f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u30b9\u30bf\u30a4\u30eb\u30fb\u624b\u6cd5\u306e\u3053\u3068<\/strong>\u3067\u3001\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30d1\u30e9\u30c0\u30a4\u30e0\u3068\u547c\u3070\u308c\u308b1\u3064\u3067\u3059\u3002<br>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30d1\u30e9\u30c0\u30a4\u30e0\u306b\u306f\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411(\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0)\u4ee5\u5916\u306b\u3082\u3001\u95a2\u6570\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3001<strong>\u624b\u7d9a\u304d\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0<\/strong>\u304c\u3042\u308a\u307e\u3059\u3002<br>\u624b\u7d9a\u304d\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3067\u306f\u3001\u9023\u7d9a\u3057\u305f\u624b\u7d9a\u304d\u3092\u8a18\u8ff0\u3057\u3001\u4e0a\u304b\u3089\u4e0b\u3078\u3068\u6d41\u308c\u3001\u5909\u6570\u306a\u3069\u306e\u72b6\u614b\u304c\u5909\u5316\u3057\u306a\u304c\u3089\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3044\u304d\u307e\u3059\u3002<br>\u4f8b\u3048\u3070\u3001\u624b\u7d9a\u304d\u578b\u3068\u306f\u6b21\u306e\u3088\u3046\u306a\u3082\u306e\u3092\u8a00\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>a = 10\nb = 20\ny = a + b\nprint(y) # 20\n<\/code><\/pre>\n\n\n\n<p>\u3057\u304b\u3057\u3001<strong>\u624b\u7d9a\u304d\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u306f\u3001\u3059\u3079\u3066\u306e\u30b3\u30fc\u30c9\u304c<a href=\"https:\/\/aiacademy.jp\/media\/?id=6&amp;section=%E9%96%A2%E6%95%B0%20%E5%A4%89%E6%95%B0%E3%81%AE%E3%82%B9%E3%82%B3%E3%83%BC%E3%83%97\">\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570<\/a>\u306a\u305f\u3081\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u591a\u304f\u306a\u308b\u306b\u3064\u308c\u69d8\u3005\u306a\u554f\u984c\u304c\u51fa\u3066\u304d\u307e\u3059\u3002<\/strong><br>\u4f8b\u3048\u3070\u3001\u3042\u308b\u95a2\u6570\u3067\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u3092\u5909\u66f4\u3057\u3001\u5225\u3067\u66f8\u3044\u305f\u95a2\u6570\u3067\u305d\u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u3092\u4e0a\u66f8\u304d\u3059\u308b\u306a\u3069\u3067\u3059\u3002<br>\u3053\u3046\u3059\u308b\u3068<strong>\u624b\u7d9a\u304d\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u5834\u5408\u3001\u6b21\u7b2c\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u7ba1\u7406\u3059\u308b\u3053\u3068\u304c\u56f0\u96e3\u306b\u306a\u3063\u3066\u304d\u307e\u3059\u3002<\/strong><br>\u305d\u306e\u554f\u984c\u3092\u89e3\u6c7a\u3059\u308b\u304d\u3063\u304b\u3051\u306b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u304c\u767b\u5834\u3057\u3066\u3044\u307e\u3059\u3002<br><strong><em>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u306f\u4e0a\u8a18\u306e\u554f\u984c\u3092\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u958b\u767a\u306e\u52b9\u7387\u3084\u4fdd\u5b88\u6027\u3092\u4e0a\u3052\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/em><\/strong><br>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u3092\u6d3b\u7528\u53ef\u80fd\u306a\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306f\u3001Python\u3084Java\u3001C++\u3068\u3044\u3063\u305f\u8a00\u8a9e\u304c\u6319\u3052\u3089\u308c\u307e\u3059\u3002<br>\u4eca\u56de\u306f\u3001Python\u3092\u4f7f\u3044\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u306e\u57fa\u790e\u3068\u306a\u308b\u30af\u30e9\u30b9\u304b\u3089\u8aac\u660e\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-68\">\u30af\u30e9\u30b9<\/h2>\n\n\n\n<p>\u4ee5\u524d\u3001int\u3084str\u306a\u3069\u306e\u30c7\u30fc\u30bf\u578b\u3092\u898b\u3066\u304d\u307e\u3057\u305f\u304c\u3001<strong><em>\u30af\u30e9\u30b9\u3068\u306f\u30c7\u30fc\u30bf\u69cb\u9020\u3092\u4f5c\u308b\u4ed5\u7d44\u307f<\/em><\/strong>\u3067\u3001<strong>\u30af\u30e9\u30b9\u3092\u4f7f\u3046\u3068\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u578b\u3092\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/strong><br>\u3088\u304f\u30af\u30e9\u30b9\u306f\u3001<strong><em>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u308b\u8a2d\u8a08\u66f8<\/em><\/strong>\u3068\u8aac\u660e\u3055\u308c\u307e\u3059\u3002<br>\u30af\u30e9\u30b9\u3068\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u95a2\u4fc2\u306e\u30a4\u30e1\u30fc\u30b8\u56f3\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong>\u30af\u30e9\u30b9\uff08\u30c7\u30fc\u30bf\u69cb\u9020\u3092\u4f5c\u308b\u4ed5\u7d44\u307f\u3067\u8a2d\u8a08\u56f3\uff09\u2192\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\uff08\u305f\u3053\u713c\u304d\u3092\u713c\u304f\uff09\u306b\u3088\u308a\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\uff08\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09\u3092\u4f5c\u6210<\/strong>\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/aiacademy.jp\/assets\/images_test\/18_16d8aff6311.png\" alt=\"\"><\/figure>\n\n\n\n<p><strong>\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3068\u3044\u3046\u306e\u306f\u30af\u30e9\u30b9\u304b\u3089\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\uff08\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09\u3092\u4f5c\u308b\u3053\u3068\u3067\u3059\u3002<\/strong><br>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u95a2\u3057\u3066\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u306b\u3066\u8aac\u660e\u81f4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3067\u306f\u65e9\u901f\u5b9f\u969b\u306b\u30af\u30e9\u30b9\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"\"\"\n\u30af\u30e9\u30b9\u3092\u4f5c\u308b\u6642\u306f\u3001CamelCase\uff08\u30ad\u30e3\u30e1\u30eb\u30b1\u30fc\u30b9\uff09\u300c\u5358\u8a9e\u306e\u982d\u6587\u5b57\u3092\u5927\u6587\u5b57\u306b\u3057\u3066\u63a5\u7d9a\u3059\u308b\u66f8\u5f0f\u300d\u3067\u4f5c\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n\u307e\u305f\u3001\u95a2\u6570\u3084\u3053\u306e\u7ae0\u3067\u767b\u5834\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u306e\u5834\u5408\u306f\u3001\u30b9\u30cd\u30fc\u30af\u30b1\u30fc\u30b9(\u5c0f\u6587\u5b57\u306e\u5358\u8a9e\u540c\u58eb\u3092\u30a2\u30f3\u30c0\u30fc\u30b9\u30b3\u30a2\u3067\u7e4b\u3050\u5f62\u5f0f\uff09\u3092\u4f7f\u3044\u307e\u3059\u3002\uff08\u4f59\u8ac7\u3067\u3059\u304c\u3001\u5c0f\u6587\u5b57\u306e\u307f\u3067\u30a2\u30f3\u30c0\u30fc\u30b9\u30b3\u30a2\u306a\u3057\u306e\u3053\u3068\u3092lower\u30b1\u30fc\u30b9\u3068\u547c\u3073\u307e\u3059\u3002\uff09\n\"\"\"\n# Sample\u30af\u30e9\u30b9\u3092\u4f5c\u308a\u307e\u3059\u3002\uff08\u4fdd\u5b58\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u540d\u306f\u4efb\u610f\u306e\u540d\u524d\u3067\u53ef\u80fd\u3067\u3059\u3002\uff09\nclass SampleClass: # \u30af\u30e9\u30b9\u540d\u306e\u6700\u521d\u306e\u6587\u5b57\u306f\u5927\u6587\u5b57\u3067\u3001\u307e\u305f\u8907\u6570\u306e\u5358\u8a9e\u306e\u982d\u6587\u5b57\u306f\u5927\u6587\u5b57\u306b\u3057\u307e\u3059\n    # \u30af\u30e9\u30b9\u5185\u3067\u306f\u30b9\u30da\u30fc\u30b9\u30924\u3064\u958b\u3051\u3066\u30a4\u30f3\u30c7\u30f3\u30c8\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30af\u30e9\u30b9\u306e\u4e2d\u306b\u306f\u5909\u6570\u3084\u30e1\u30bd\u30c3\u30c9\uff08\u30af\u30e9\u30b9\u306e\u4e2d\u306b\u3042\u308b\u95a2\u6570\u3092\u30e1\u30bd\u30c3\u30c9\uff09\u3092\u5b9a\u7fa9\u3067\u304d\u307e\u3059\u3002\n     '''sample class '''\nsample = SampleClass() # \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9 \u30af\u30e9\u30b9\u3092\u4f7f\u3046\u306b\u306f\u3001\u95a2\u6570\u306e\u547c\u3073\u51fa\u3057\u306e\u3088\u3046\u306b\u3001\u30af\u30e9\u30b9\u540d()\u3059\u308b\u3053\u3068\u3067\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3057\u307e\u3059\u3002\u3053\u3046\u3059\u308b\u3053\u3068\u3067\u30af\u30e9\u30b9\u3092\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002sample\u306bSampleClass\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\u683c\u7d0d\u3055\u308c\u307e\u3057\u305f\u3002\u30af\u30e9\u30b9\u304b\u3089\u3064\u304f\u3089\u308c\u305f\u3053\u306e\u30c7\u30fc\u30bf\u3092\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3068\u547c\u3073\u307e\u3059\u3002\nsample.name = \"A\"\nsample2 = SampleClass() # \u3053\u306eSample\u578b\u304b\u3089\u3001\u3044\u304f\u3064\u3067\u3082\u30c7\u30fc\u30bf\u3092\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067sample2\u3092\u4f5c\u308a\u307e\u3057\u3087\u3046\u3002\nsample2.name = \"B\" # sample2\u306b\u5bfe\u3057\u3066\u3055\u307e\u3056\u306a\u306a\u5c5e\u6027\u3092\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002\nprint(sample.name) # sample\u306e\u540d\u524d\u306fA\nprint(sample2.name) # sample2\u306e\u540d\u524d\u306fB\n<\/code><\/pre>\n\n\n\n<p>\u7a7a\u306e\u30af\u30e9\u30b9\uff08\u4e2d\u8eab\u306e\u306a\u3044\u30af\u30e9\u30b9\uff09\u3092\u4f5c\u308b\u306b\u306f\u6b21\u306e\u3088\u3046\u306b\u66f8\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class SampleClass:\n    pass # pass\u3092\u4f7f\u3046\u3053\u3068\u3067\u7a7a\u306e\u30af\u30e9\u30b9(\u3084\u95a2\u6570)\u3092\u4f5c\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002\nsample = SampleClass()\nsample.name = \"Sample\"\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-69\">\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/h2>\n\n\n\n<p><strong>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u306f\u30c7\u30fc\u30bf\uff08\u5c5e\u6027\uff09\u3068\u30e1\u30bd\u30c3\u30c9\uff08\u30af\u30e9\u30b9\u306b\u5b9a\u7fa9\u3055\u308c\u305f\u95a2\u6570\uff09\u3092\u6301\u3063\u305f\u3082\u306e\u3067\u3059\u3002<\/strong><br>\u305d\u3057\u3066\u3001Python\u306e\u5024\u306f\u5168\u3066\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3042\u308a\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u306f\u5b9f\u884c\u3067\u51fa\u6765\u308b\u95a2\u6570\uff08\u30e1\u30bd\u30c3\u30c9\uff09\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-70\">\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf<\/h2>\n\n\n\n<p><strong>\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306f\u5bfe\u8c61\u306e\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u521d\u671f\u5316\u3059\u308b\u305f\u3081\u306b\u5229\u7528\u3057\u307e\u3059\u3002<\/strong><br>\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u308b\u6642\u306b\u521d\u671f\u5024\u3092\u4e0e\u3048\u305f\u3044\u6642\u306b\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3092\u4f7f\u3046\u3068\u4fbf\u5229\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u30af\u30e9\u30b9\u306b\u306f<strong><em>__init__<\/em><\/strong>\u3068\u3044\u3046\u7279\u6b8a\u306a\u30e1\u30bd\u30c3\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br><strong>\u3053\u308c\u304c\u521d\u671f\u5316\u3092\u884c\u3046\u30e1\u30bd\u30c3\u30c9\u3067\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3068\u547c\u3073\u3001\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\u4f5c\u6210\u3055\u308c\u308b\u969b\u306b\u4e00\u5ea6\u3060\u3051\u547c\u3070\u308c\u308b\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002<\/strong><br>\u307e\u305f\u3001<strong>\u30af\u30e9\u30b9\u304c\u5185\u5305\u3059\u308b\u30c7\u30fc\u30bf\u3092\u5c5e\u6027<\/strong>\u3068\u547c\u3073\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5b9f\u969b\u306b\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<br>\uff08\u4eca\u56de\u306fUser\u30af\u30e9\u30b9\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3059\u3002\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class User:\n    def __init__(self, name): # \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3055\u308c\u3066\u6e21\u3063\u3066\u304f\u308b\u5024\u3092\u53d7\u3051\u308b\u5909\u6570\u3092\u5b9a\u7fa9\u3057\u307e\u3059\n        # \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\uff08\u5c5e\u6027\u306e\u521d\u671f\u5316\uff09\n        self.name = name\n        print(\"\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u304c\u547c\u3070\u308c\u307e\u3057\u305f\")\n    def hello(self):\n        print(\"Hello \" + self.name)\nuser = User(\"Sample User\") # user\u3068\u3044\u3046\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u751f\u6210\u3057\u3066\u3044\u307e\u3059\u3002\n<\/code><\/pre>\n\n\n\n<p>User\u30af\u30e9\u30b9\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306fname\u3068\u3044\u3046\u5f15\u6570\u3092\u53d6\u308a\u3001\u305d\u306e\u5f15\u6570\u3067\u5909\u6570\u3067\u3042\u308bself.name\uff08\u3053\u306e\u5909\u6570\u306e\u3053\u3068\u3092\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u3068\u547c\u3073\u307e\u3059\uff09\u3092\u521d\u671f\u5316\u3057\u3066\u3044\u307e\u3059\u3002<br>\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u306f\u3001\u500b\u3005\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u683c\u7d0d\u3055\u308c\u308b\u5909\u6570\u306e\u3053\u3068\u3067\u3059\u3002<br>\u3053\u3053\u3067\u306fname\u304c\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u3067\u3059\u3002<br>hello\u30e1\u30bd\u30c3\u30c9\u5185\u3067\u3001self\u306e\u5f8c\u306b\u5c5e\u6027\u540d\u3092\u66f8\u3044\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u306e\u3088\u3046\u306b\u66f8\u304f\u3053\u3068\u3067\u3001\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u306e\u4f5c\u6210\u53ca\u3073\u30a2\u30af\u30bb\u30b9\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>user = User(\"Sample User\")\npy = User(\"python\")\nuser.hello()\npy.hello()\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-71\">\u30e1\u30bd\u30c3\u30c9<\/h2>\n\n\n\n<p><strong>\u30e1\u30bd\u30c3\u30c9\u3068\u306f\u30af\u30e9\u30b9\u306b\u5b9a\u7fa9\u3055\u308c\u305f\u95a2\u6570\u306e\u3053\u3068\u3067\u3059\u3002<\/strong><br>\u524d\u56de\u3001\u7a7a\u306eSampleClass\u3092\u5b9a\u7fa9\u3057\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u306f\u30e1\u30bd\u30c3\u30c9\u3092\u6301\u3064\u3001SampleClass\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class SampleClass:\n    # \u30e1\u30bd\u30c3\u30c9 \u30e1\u30bd\u30c3\u30c9\u306b\u306f1\u3064\u76ee\u306e\u5f15\u6570self\u3092\u5fc5\u305a\u3064\u3051\u3066\u304f\u3060\u3055\u3044\u3002self\u3068\u3044\u3046\u306e\u306f\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u81ea\u8eab\u3092\u6307\u3057\u3066\u3044\u307e\u3059\n    def set_name(self, name):\n        self.name = name # \u53d7\u3051\u53d6\u3063\u305f\u5024\u3092SampleClasas\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u683c\u7d0d\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u306bself.name = name\u3068\u3057\u307e\u3059\u3002self\u81ea\u4f53\u304cSampleClass\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u3055\u3057\u307e\u3059\u306e\u3067\u3001name\u3068\u8a00\u3046\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u3092\u7528\u610f\u3057\u3066\u5f15\u6570name\u3092\u4ee3\u5165\u3057\u307e\u3059\u3002\n    def hello(self):\n        print(\"hello, {0}\".format(self.name))\nsample = SampleClass()\nsample2 = SampleClass()\nsample.set_name(\"Python\") # self\u306f\u81ea\u5206\u81ea\u8eab\u3092\u793a\u3059\u3082\u306e\u306a\u306e\u3067\u3001name\u306b\u5f53\u305f\u308bPython\u3060\u3051\u306e\u5f15\u6570\u3060\u3051\u3067\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002\nsample2.set_name(\"AI\")\nsample.hello()\nsample2.hello()\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-72\">\u7d99\u627f<\/h2>\n\n\n\n<p><strong>\u7d99\u627f\u306f\u65e2\u5b58\u306e\u30af\u30e9\u30b9\u3092\u3082\u3068\u306b\u65b0\u3057\u3044\u30af\u30e9\u30b9\u3092\u4f5c\u308b\u4ed5\u7d44\u307f\u3067\u3059\u3002<\/strong><br>\u7d99\u627f\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u65e2\u5b58\u306e\u30af\u30e9\u30b9\u306e\u62e1\u5f35\u304c\u52b9\u7387\u826f\u304f\u884c\u306a\u3046\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u3001\u307e\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4fdd\u5b88\u6027\u3082\u4e0a\u304c\u308a\u307e\u3059\u3002<br>User\uff08\u89aa\u30af\u30e9\u30b9\u30fb\u30b9\u30fc\u30d1\u30fc\u30af\u30e9\u30b9\u30fb\u57fa\u5e95\u30af\u30e9\u30b9\uff09-&gt; SuperUser\uff08\u5b50\u30af\u30e9\u30b9\u30fb\u30b5\u30d6\u30af\u30e9\u30b9\u30fb\u6d3e\u751f\u30af\u30e9\u30b9\uff09<br>\u3053\u308c\u304b\u3089\u5b9a\u7fa9\u3059\u308b\u5b50\u30af\u30e9\u30b9SuperUser\u30af\u30e9\u30b9\u306f\u3001\u89aa\u30af\u30e9\u30b9\u306e\u6a5f\u80fd\u304c\u5099\u308f\u3063\u3066\u3044\u308b\u305f\u3081\u3001\u5b50\u30af\u30e9\u30b9\u3092\u5b9a\u7fa9\u3059\u308b\u969b\u306b\u306f\u65b0\u3057\u304f\u8ffd\u52a0\u3057\u305f\u3044\u6a5f\u80fd\u3060\u3051\u3092\u5b9a\u7fa9\u3059\u308b\u3060\u3051\u3067\u6e08\u307f\u307e\u3059\u3002<br>\u7d99\u627f\u3059\u308b\u3053\u3068\u3067\u65e2\u5b58\u306e\u30af\u30e9\u30b9\u3092\u518d\u5229\u7528\u3057\u3001\u65b0\u305f\u306a\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br>\u3067\u306f\u5b9f\u969b\u306b\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class User:\n    def __init__(self, name):\n        self.name = name\n    def hello(self):\n        print(\"Hello \" + self.name)\nclass SuperUser(User): # \u30e6\u30fc\u30b6\u30fc\u30af\u30e9\u30b9\u3092\u7d99\u627f\u3059\u308b\u306b\u306f\u3001()\u306e\u4e2d\u306bUser\u30af\u30e9\u30b9\u3092\u66f8\u3051\u3070oK\u3067\u3059\u3002\n    def __init__(self, name, age):\n        # super()\u3092\u4f7f\u3046\u3053\u3068\u3067\u89aa\u30af\u30e9\u30b9\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\n        super().__init__(name) # \u3053\u30af\u30e9\u30b9\u304b\u3089\u89aa\u30af\u30e9\u30b9\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3092\u547c\u3073\u51fa\u3059\n        self.age = age\n    # \u30e1\u30bd\u30c3\u30c9\u306e\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\n    def hello(self):\n        print(\"SuperHello\" + self.name)\n        \"\"\"\n        \u307e\u305f\u3053\u30af\u30e9\u30b9\u306e\u30e1\u30bd\u30c3\u30c9\u306e\u4e2d\u3067\u3001\u4f8b\u3048\u3070\u30aa\u30fc\u30d0\u30e9\u30a4\u30c9\u3057\u305f\n        \u30e1\u30bd\u30c3\u30c9\u5185\u3067\u3001super()\u3092\u4f7f\u3046\u3053\u3068\u3067\u89aa\u30af\u30e9\u30b9User\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\n        \"\"\"\n        super().hello()\nt = SuperUser(\"tani\", 100)\nt.hello()\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-73\">\u591a\u91cd\u7d99\u627f<\/h2>\n\n\n\n<p><strong>\u591a\u91cd\u7d99\u627f\u3068\u306f\u3001\u8907\u6570\u306e\u89aa\u30af\u30e9\u30b9\u304b\u3089\u7d99\u627f\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/strong><br>\u4e0b\u8a18\u306e\u4f8b\u3067\u306f\u3001Base1\u3068Base2\u306e2\u3064\u304c\u89aa\u30af\u30e9\u30b9(\u57fa\u5e95\u30af\u30e9\u30b9\uff09\u3067\u305d\u306e2\u3064\u304b\u3089\u7d99\u627f\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"\"\"\nPython\u306f\u591a\u91cd\u7d99\u627f\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u3002\n\u8907\u6570\u306e\u57fa\u5e95\u30af\u30e9\u30b9\u3092\u6301\u3064\u30af\u30e9\u30b9\u5b9a\u7fa9\u306f\u6b21\u306e\u3088\u3046\u306a\u69cb\u6587\u306b\u306a\u308a\u307e\u3059\u3002\n\"\"\"\nclass SampleClassName(Base1, Base2):\n    \u30fb\u30fb\u30fb\u30fb\n    \u30fb\u30fb\u30fb\u30fb\n    # \u4e0a\u8a18\u306eBase1\u3092\u7d99\u627f\u3057\u305f\u5f8c\u306bBase2\u3092\u7d99\u627f\u3057\u307e\u3059\u3002\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-74\">\u30e1\u30bd\u30c3\u30c9\u306e\u30aa\u30fc\u30d0\u30e9\u30a4\u30c9<\/h2>\n\n\n\n<p><strong><em>\u30e1\u30bd\u30c3\u30c9\u3092\u72ec\u81ea\u306e\u6a5f\u80fd\u3067\u4e0a\u66f8\u304d\u3059\u308b\u3053\u3068\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9(over ride)\u3068\u8a00\u3044\u307e\u3059\u3002<\/em><\/strong><br>\u4e0b\u8a18\u306eDerived\u30af\u30e9\u30b9\u5185\u306esample\u30e1\u30bd\u30c3\u30c9\u304cBase\u30af\u30e9\u30b9\u306esample\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b\u3053\u3068\u3067\u4e0a\u66f8\u304d\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br>\u4eca\u56desample\u30e1\u30bd\u30c3\u30c9\u306e\u307f\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3057\u307e\u3057\u305f\u304c\u3001__init()__\u3092\u542b\u3080\u3042\u3089\u3086\u308b\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u51fa\u6765\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u57fa\u5e95\u30af\u30e9\u30b9\nclass Base:\n    def sample(self):\n        print(\"Base.sample()\u304c\u547c\u3070\u308c\u307e\u3057\u305f\")\n    def test(self):\n        print(\"Base\u30af\u30e9\u30b9test\u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3070\u308c\u307e\u3057\u305f\")\n# \u6d3e\u751f\u30af\u30e9\u30b9\nclass Derived(Base):\n    def sample(self): # Base\u30af\u30e9\u30b9\u306esample\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\n        print(\"Derived.sample()\u304c\u547c\u3070\u308c\u307e\u3057\u305f\")\n        self.test() # Base\u30af\u30e9\u30b9\u306etest\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\nd = Derived()\nd.sample()\n<\/code><\/pre>\n\n\n\n<p>\u5143\u306eBase\u30af\u30e9\u30b9\u306f\u3001<strong><em>\u89aa\u30af\u30e9\u30b9\u3082\u3057\u304f\u306f\u30b9\u30fc\u30d1\u30fc\u30af\u30e9\u30b9\uff08\u3082\u3057\u304f\u306f\u57fa\u5e95\u30af\u30e9\u30b9\uff09<\/em><\/strong>\u3068\u547c\u3070\u308c\u307e\u3059\u3002<br>\u65b0\u3057\u304f\u3067\u304d\u305fDerived\u30af\u30e9\u30b9\u306f\u5b50\u30af\u30e9\u30b9\u3001\u30b5\u30d6\u30af\u30e9\u30b9\u3001\u6d3e\u751f\u30af\u30e9\u30b9\u306a\u3069\u3068\u547c\u3070\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"i-75\">\u307e\u3068\u3081<\/h1>\n\n\n\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001Python\u3068\u306f\u4f55\u304b\u3001Python\u3067\u51fa\u6765\u308b\u3053\u3068\u3001\u5909\u6570\u3068\u30c7\u30fc\u30bf\u578b\u3001if\u6587\u3084for\u6587\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u3084\u30af\u30e9\u30b9\u306a\u3069\u3092\u5b66\u3073\u307e\u3057\u305f\u3002\u3069\u308c\u3082\u57fa\u672c\u7684\u306a\u5185\u5bb9\u3067\u3059\u306e\u3067\u3001\u3057\u3063\u304b\u308a\u62bc\u3055\u3048\u307e\u3057\u3087\u3046\u3002<br>\u203b\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u5192\u982d\u3067\u8aac\u660e\u3057\u305f\u901a\u308a\u3001AI Academy\u306ePython<a href=\"https:\/\/aiacademy.jp\/texts\/#grammar\" target=\"_blank\" rel=\"noreferrer noopener\">\u6587\u6cd5\u901f\u7fd2\u7de8<\/a>\u3068<a href=\"https:\/\/aiacademy.jp\/texts\/#python\" target=\"_blank\" rel=\"noreferrer noopener\">Python \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5165\u9580\u7de8<\/a>\u306e\u5185\u5bb9\u3092\u30d9\u30fc\u30b9\u306b\u4e00\u90e8\u4fee\u6b63\u3092\u52a0\u3048\u305f\u3082\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"i-76\">\u3082\u3063\u3068Python\u3092\u5b66\u3073\u305f\u3044\u65b9\u3078<\/h1>\n\n\n\n<p><a href=\"https:\/\/aiacademy.jp\/bootcamp\" target=\"_blank\" rel=\"noreferrer noopener\">AI Academy Bootcamp<\/a>&nbsp;\u3067\u306f<strong>AI\u30fb\u30c7\u30fc\u30bf\u30b5\u30a4\u30a8\u30f3\u30b9\u3001\u6a5f\u68b0\u5b66\u7fd2\u306e\u5b9f\u8df5\u529b\u3092\u9ad8\u3081\u308b\u51684\u30b3\u30fc\u30b940\u6642\u9593\u4ee5\u4e0a\u306e\u52d5\u753b\u304c\u898b\u653e\u984c\uff01<\/strong>AI\u306e\u5b66\u7fd2\u306b\u5fc5\u9808\u306ePython\u306e\u5b66\u7fd2\u304b\u3089\u59cb\u307e\u308a\u3001\u30c7\u30fc\u30bf\u30b5\u30a4\u30a8\u30f3\u30b9\u30fb\u6a5f\u68b0\u5b66\u7fd2\u306a\u3069\u3001\u76ee\u7684\u306b\u5fdc\u3058\u305f\u5e45\u5e83\u3044\u5206\u91ce\u3092\u30ab\u30d0\u30fc\u3057\u3066\u3044\u307e\u3059\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\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u30b5\u30a4\u30c8\u306f\u3001Python\u3084\u751f\u6210AI\u306a\u3069\u3092\u5b66\u3079\u308b\u30aa\u30f3\u30e9\u30a4\u30f3\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb AI Academy Bootcamp\u304c\u904b\u55b6\u3057\u3066\u3044\u307e\u3059\u3002 \u76ee\u6b21 \u306f\u3058\u3081\u306b \u306a\u305cPython\u306a\u306e\u304b\uff1f Python\u74b0\u5883\u69cb\u7bc9 \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":5756,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[85,95,94,101,102,100,105,93,98,90,97],"tags":[],"class_list":{"0":"post-265","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python","8":"category-for","9":"category-if","10":"category-101","11":"category-102","12":"category-100","13":"category-105","14":"category-93","15":"category-98","16":"category-90","17":"category-97"},"_links":{"self":[{"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts\/265","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=265"}],"version-history":[{"count":37,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts\/265\/revisions"}],"predecessor-version":[{"id":7589,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts\/265\/revisions\/7589"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/media\/5756"}],"wp:attachment":[{"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=265"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}