{"id":5819,"date":"2025-03-28T14:21:33","date_gmt":"2025-03-28T05:21:33","guid":{"rendered":"https:\/\/yorozu.cloudfree.jp\/wordpress\/?p=5819"},"modified":"2025-03-28T15:24:13","modified_gmt":"2025-03-28T06:24:13","slug":"5819","status":"publish","type":"post","link":"https:\/\/yorozu.cloudfree.jp\/wordpress\/?p=5819","title":{"rendered":"\u7df4\u7fd2\u554f\u984c\uff0821\u301c25\uff09"},"content":{"rendered":"\n<p>\u5b9f\u884c\u4f8b\u306f\u300cstupa.sarnath\u300d\u306e\u300cGoogle Colabotry\u300d\u74b0\u5883\u306b\u4fdd\u5b58\u3057\u3066\u3042\u308b<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>&quot;&quot;&quot;\n\n21. \u30ea\u30b9\u30c8\uff08for\u306b\u3088\u308b\u635c\u67fb, enumerate\uff09\n\u5909\u6570\u306b[1,2,3,4,5]\u306e5\u3064\u306e\u8981\u7d20\u3092\u6301\u3064\u30ea\u30b9\u30c8\u3092\u683c\u7d0d\u3057\u3066\uff0c\u6dfb\u3048\u5b57\u304c\u5076\u6570\u756a\u76ee\u306e\u8981\u7d20\u3060\u3051\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\uff0e\u51fa\u529b\u5f62\u5f0f\u306f\u554f\u3044\u307e\u305b\u3093\uff0e\u305f\u3060\u3057\uff0c\u5148\u982d\u306e\u6dfb\u3048\u5b57\u30920\u756a\u76ee\u3068\u3057\u307e\u3059\uff0e\n\n\u671f\u5f85\u3059\u308b\u51fa\u529b\uff1a1 3 5\n\n22. \u30ea\u30b9\u30c8\uff08len\uff09\n\u5909\u6570\u306b\u30ea\u30b9\u30c8[11,22,33,44,55,66]\u3092\u4ee3\u5165\u3057\uff0c\u30ea\u30b9\u30c8\u306e\u8981\u7d20\u6570\u3092\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\uff0e\n\n\u671f\u5f85\u3059\u308b\u51fa\u529b\uff1a6\n\n23. \u30ea\u30b9\u30c8\uff0cif\uff08\u5b58\u5728\u78ba\u8a8d\uff09\n\u30ea\u30b9\u30c8[11,22,33,44,55]\u306b\uff0c\u502444\u304c\u5b58\u5728\u3059\u308b\u304b\u3069\u3046\u304b\u3092if\u3092\u7528\u3044\u3066\u5224\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\uff0e\u5b58\u5728\u3059\u308c\u3070True\uff0c\u305d\u3046\u3067\u306a\u3051\u308c\u3070False\u3092\u51fa\u529b\u3057\u307e\u3059\uff0e\n\n\u671f\u5f85\u3059\u308b\u51fa\u529b\uff1aTrue\n\n24. \u30bf\u30d7\u30eb\uff0c\u30ea\u30b9\u30c8\u306e\u8ca0\u306eindex\n\u5909\u6570\u306b[1,2,3,4,5]\u306e5\u3064\u306e\u8981\u7d20\u3092\u6301\u3064\u30ea\u30b9\u30c8\u3092\u683c\u7d0d\u3057\u3066\uff0c\u30ea\u30b9\u30c8\u306e\u5148\u982d\u306e\u8981\u7d20\u3068\u672b\u5c3e\u306e\u8981\u7d20\u3092\u30bf\u30d7\u30eb\u3068\u3057\u3066\u683c\u7d0d\u3057\uff0c\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\uff0e\n\n\u671f\u5f85\u3059\u308b\u51fa\u529b\uff1a(1, 5)\n\n25. \u8f9e\u66f8\n\u5909\u6570\u306b\uff0c\u5024\u306e\u7d44\u307f\u3068\u3057\u3066{&#39;A&#39;:1, &#39;B&#39;:2, &#39;C&#39;:3, &#39;D&#39;:4, &#39;E&#39;:5}\u3092\u6301\u3064\u8f9e\u66f8\u3092\u683c\u7d0d\u3057\u3066\uff0c\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\uff0e\n\n\u671f\u5f85\u3059\u308b\u51fa\u529b\uff1a{&#39;A&#39;: 1, &#39;B&#39;: 2, &#39;C&#39;: 3, &#39;D&#39;: 4, &#39;E&#39;: 5}\n\n&quot;&quot;&quot;\n#\n#\n#21. \u30ea\u30b9\u30c8\uff08for\u306b\u3088\u308b\u635c\u67fb, enumerate\uff09\n#\nprint(&quot;21. \u30ea\u30b9\u30c8\uff08for\u306b\u3088\u308b\u635c\u67fb, enumerate\uff09&quot;)\nx = [1,2,3,4,5]\nfor i, sfix in enumerate(x):   #\u6b63\u89e3\n  if i % 2 == 0:\n    print(sfix)\n#\n#22. \u30ea\u30b9\u30c8\uff08len\uff09\n#\nprint(&quot;22. \u30ea\u30b9\u30c8\uff08len\uff09\uff09&quot;) \nx = [11,22,33,44,55,66]\nprint(len(x))\n#\n#23. \u30ea\u30b9\u30c8\uff0cif\uff08\u5b58\u5728\u78ba\u8a8d\uff09\n#\nprint(&quot;23. \u30ea\u30b9\u30c8\uff0cif\uff08\u5b58\u5728\u78ba\u8a8d\uff09&quot;) \nx = [11,22,33,44,55]\nif 44 in x:             #\u6b63\u89e3\n  print(&#39;true&#39;)\nelse:\n  print(&#39;false&#39;)\n#\n#24. \u30bf\u30d7\u30eb\uff0c\u30ea\u30b9\u30c8\u306e\u8ca0\u306eindex\n#\nprint(&quot;24. \u30bf\u30d7\u30eb\uff0c\u30ea\u30b9\u30c8\u306e\u8ca0\u306eindex&quot;) \nx = [1,2,3,4,5]\ny = (x[0], x[-1])       #\u6b63\u89e3\nprint(y)\n#\n#25. \u8f9e\u66f8\n#\nprint(&quot;25. \u8f9e\u66f8&quot;) \nx = {&#39;A&#39;:1, &#39;B&#39;:2, &#39;C&#39;:3, &#39;D&#39;:4, &#39;E&#39;:5}\nprint(x)<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u30fbPython\u5b66\u7fd2\uff08\uff15\uff15\u672c\u30ce\u30c3\u30af\uff09\u306b\u3064\u3044\u3066<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[54],"tags":[17],"class_list":["post-5819","post","type-post","status-publish","format-standard","hentry","category-99_","tag-python"],"_links":{"self":[{"href":"https:\/\/yorozu.cloudfree.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yorozu.cloudfree.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yorozu.cloudfree.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yorozu.cloudfree.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/yorozu.cloudfree.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5819"}],"version-history":[{"count":5,"href":"https:\/\/yorozu.cloudfree.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5819\/revisions"}],"predecessor-version":[{"id":5857,"href":"https:\/\/yorozu.cloudfree.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5819\/revisions\/5857"}],"wp:attachment":[{"href":"https:\/\/yorozu.cloudfree.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yorozu.cloudfree.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yorozu.cloudfree.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}