{"id":620,"date":"2018-08-12T18:39:23","date_gmt":"2018-08-12T09:39:23","guid":{"rendered":"https:\/\/python-introduction.com\/?p=620"},"modified":"2018-08-12T18:39:23","modified_gmt":"2018-08-12T09:39:23","slug":"%e3%80%90python%e3%80%91%e3%83%aa%e3%82%b9%e3%83%88%e3%81%ae%e8%a6%81%e7%b4%a0%e6%95%b0%e3%82%92%e5%8f%96%e5%be%97%e3%81%97%e3%81%9f%e3%82%8a%e6%8a%bd%e5%87%ba%e3%81%97%e3%81%9f%e3%82%8a%e3%81%99","status":"publish","type":"post","link":"https:\/\/python-introduction.com\/?p=620","title":{"rendered":"\u3010Python\u3011\u30ea\u30b9\u30c8\u306e\u8981\u7d20\u6570\u3092\u53d6\u5f97\u3057\u305f\u308a\u62bd\u51fa\u3057\u305f\u308a\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u3053\u306e\u8a18\u4e8b\u3067\u306fPython\u3067\u30ea\u30b9\u30c8\u306e\u8981\u7d20\u6570\u3092\u53d6\u5f97\u3057\u305f\u308a<br \/>\n\u62bd\u51fa\u3057\u305f\u308a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<p>\u30ea\u30b9\u30c8\u3092\u8ffd\u52a0\u3057\u305f\u308a\u7d50\u5408\u3057\u305f\u308a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f<br \/>\n\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3067\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<div class=\"linkcard\"><table border=\"1\" cellspacing=\"0\" cellpadding=\"4\"><tbody><\/tr><tr><td>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u30ea\u30b9\u30c8\u3092\u8ffd\u52a0\u3057\u305f\u308a\u7d50\u5408\u3057\u305f\u308a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002\u30ea\u30b9\u30c8\u3068\u8a00\u3046\u3088\u308a\u3001\u5358\u7d14\u306b\u6587\u5b57\u5217\u3092\u7d50\u5408\u3055\u305b\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3067\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002\u6c17\u306b\u306a\u308b\u65b9\u306f\u3054\u89a7\u304f\u3060\u3055\u3044\u3002\u305d\u308c\u3067\u306f\u672c\u984c\u306b\u5165\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002\u3010Python\u3011\u30ea\u30b9\u30c8\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9...<br><a class=\"no_icon\" href=\"https:\/\/python-introduction.com\/?p=600\">\u3010Python\u3011\u30ea\u30b9\u30c8\u3092\u8ffd\u52a0\u3057\u305f\u308a\u7d50\u5408\u3057\u305f\u308a\u3059\u308b\u65b9\u6cd5<\/a> - python\u5165\u9580\u30c9\u30c3\u30c8\u30b3\u30e0<\/td><\/tr><\/tbody><\/table><\/div>\n<p>\u3067\u306f\u672c\u984c\u306b\u5165\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">\u76ee\u6b21<\/p><ul class=\"toc_list\"><li><a href=\"#Python\"><span class=\"toc_number toc_depth_1\">1<\/span> \u3010Python\u3011\u30ea\u30b9\u30c8\u306e\u8981\u7d20\u6570\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5<\/a><\/li><li><a href=\"#python\"><span class=\"toc_number toc_depth_1\">2<\/span> \u3010python\u3011\u5404\u8981\u7d20\u306e\u51fa\u73fe\u500b\u6570\u3092\u8abf\u3079\u308b\u65b9\u6cd5<\/a><\/li><li><a href=\"#Python-2\"><span class=\"toc_number toc_depth_1\">3<\/span> \u3010Python\u3011\u30ea\u30b9\u30c8\u5185\u306e\u5fc5\u8981\u306a\u8981\u7d20\u3092\u62bd\u51fa\u3059\u308b\u65b9\u6cd5<\/a><\/li><li><a href=\"#Python-3\"><span class=\"toc_number toc_depth_1\">4<\/span> \u3010Python\u3011\u30ea\u30b9\u30c8\u306b\u76ee\u7684\u306e\u8981\u7d20\u304c\u5165\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3059\u308b\u65b9\u6cd5<\/a><\/li><li><a href=\"#i\"><span class=\"toc_number toc_depth_1\">5<\/span> \u30ea\u30b9\u30c8\u306e\u4e2d\u306b\u30ea\u30b9\u30c8\u3092\u5165\u308c\u308b\u65b9\u6cd5<\/a><\/li><\/ul><\/div>\n<h2><span id=\"Python\">\u3010Python\u3011\u30ea\u30b9\u30c8\u306e\u8981\u7d20\u6570\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5<\/span><\/h2>\n<p>Python\u3067\u30ea\u30b9\u30c8\u306e\u8981\u7d20\u6570\u3092\u53d6\u5f97\u3059\u308b\u5834\u5408\u3001<br \/>\nlen()\u3068\u3044\u3046\u7d44\u307f\u8fbc\u307f\u95a2\u6570\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u984c\u3092\u3084\u3063\u3066\u307f\u305f\u65b9\u304c\u7406\u89e3\u3057\u3084\u3059\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u306a\u306e\u3067\u3001\u4f8b\u984c1\u3092\u3084\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c1\r\n\r\na = [100,200,300,400,500]\r\nb = len(a)\r\n\r\nprint(b)<\/pre>\n<p>\u4f8b\u984c1\u3067\u306f\u30ea\u30b9\u30c8a\u306e\u4e2d\u306b<br \/>\n5\u3064\u306e\u8981\u7d20\u304c\u5165\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>5\u3064\u306e\u8981\u7d20\u3068\u306f<br \/>\n[100,200,300,400,500]\u306e5\u3064\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u30ea\u30b9\u30c8a\u3092len\u306e\u4e2d\u306b\u5165\u308c\u308b\u3068<br \/>\n\u30ea\u30b9\u30c8a\u306e\u8981\u7d20\u6570\uff085\uff09\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u304b\u3089\u3001b\u306b\u8981\u7d20\u6570\uff085\uff09\u304c\u4ee3\u5165\u3055\u308c<br \/>\nprint\u6587\u3067\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3057\u305f\u304c\u3063\u3066\u4f8b\u984c1\u3092\u5b9f\u884c\u3059\u308b\u3068<br \/>\n5\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-623\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/listyousoe1810.jpg\" alt=\"python \u30ea\u30b9\u30c8 \u8981\u7d20\u6570 \u62bd\u51fa\" width=\"251\" height=\"164\" \/><\/p>\n<p>len\u95a2\u6570\u306f\u4f8b\u984c1\u306e\u3088\u3046\u306a\u6570\u5b57\u3060\u3051\u3067\u306a\u304f<br \/>\n\u6587\u5b57\u5217\u306e\u8981\u7d20\u6570\u3082\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u984c2\u3092\u3084\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c2\r\n\r\na = ['\u5973\u5b50\u66f4\u8863\u5ba4','\u7acb\u3061\u5165\u308a\u7981\u6b62','\u4e8b\u6545\u7269\u4ef6']\r\nb = len(a)\r\n\r\nprint(b)<\/pre>\n<p>\u4e0a\u8a18\u306e\u3088\u3046\u306b\u6587\u5b57\u5217\u306a\u3089<br \/>\n[]\u306e\u4e2d\u306b\u30b7\u30f3\u30b0\u30eb\u30af\u30aa\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u56f2\u3046\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n&#8216;\u4e8b\u6545\u7269\u4ef6&#8217;\u307f\u305f\u3044\u306a\u611f\u3058\u3067\u3002<\/p>\n<p>&#8216;\u5973\u5b50\u66f4\u8863\u5ba4&#8217;,&#8217;\u7acb\u3061\u5165\u308a\u7981\u6b62&#8217;,&#8217;\u4e8b\u6545\u7269\u4ef6&#8217;<br \/>\n\u30683\u3064\u306e\u6587\u5b57\u5217\u304c\u3042\u308a\u307e\u3059\u306d\u3002<\/p>\n<p>\u306a\u306e\u3067\u5b9f\u884c\u3059\u308b\u3068<br \/>\n3\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-626\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/mojiretujikkou812.jpg\" alt=\"len\u95a2\u6570\" width=\"353\" height=\"143\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/mojiretujikkou812.jpg 353w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/mojiretujikkou812-300x122.jpg 300w\" sizes=\"(max-width: 353px) 100vw, 353px\" \/><\/p>\n<h2><span id=\"python\">\u3010python\u3011\u5404\u8981\u7d20\u306e\u51fa\u73fe\u500b\u6570\u3092\u8abf\u3079\u308b\u65b9\u6cd5<\/span><\/h2>\n<p>\u3055\u3063\u305d\u304f\u4f8b\u984c3\u3092\u3084\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c3\r\n\r\na = ['\u5973\u5b50\u66f4\u8863\u5ba4','\u7537\u5b50\u66f4\u8863\u5ba4','\u5973\u5b50\u66f4\u8863\u5ba4','\u66f4\u8863\u5ba4','\u5973\u5b50\u66f4\u8863\u5ba4','\u5973\u5b50\u66f4\u8863\u5ba4']\r\nb = a.count('\u5973\u5b50\u66f4\u8863\u5ba4')\r\n\r\nprint(b)<\/pre>\n<p>\u5404\u8981\u7d20\u3068\u3044\u3063\u3066\u3044\u308b\u306e\u306f\u4f8b\u984c3\u3067\u306f<br \/>\n\u30fb\u5973\u5b50\u66f4\u8863\u5ba4\uff084\u3064\u3042\u308b\uff09<br \/>\n\u30fb\u7537\u5b50\u66f4\u8863\u5ba4\uff081\u3064\u3042\u308b\uff09<br \/>\n\u30fb\u66f4\u8863\u5ba4\uff081\u3064\u3042\u308b\uff09<\/p>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u3067\u3001\u5404\u8981\u7d20\u306e\u51fa\u73fe\u500b\u6570\u3092\u8abf\u3079\u308b\u306b\u306f<br \/>\ncount\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">b = a.count('\u5973\u5b50\u66f4\u8863\u5ba4')<\/pre>\n<p>\u3068\u8a00\u3063\u305f\u611f\u3058\u3067\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>a\u306b\u5165\u3063\u3066\u3044\u308b\u300e\u5973\u5b50\u66f4\u8863\u5ba4\u300f\u306e\u51fa\u73fe\u500b\u6570\u306e\u6570\u3092<br \/>\n\u8868\u793a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u884c\u3059\u308b\u3068<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-628\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/josikouisitucount812.jpg\" alt=\"\u5973\u5b50\u66f4\u8863\u5ba4\" width=\"582\" height=\"143\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/josikouisitucount812.jpg 582w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/josikouisitucount812-300x74.jpg 300w\" sizes=\"(max-width: 582px) 100vw, 582px\" \/><\/p>\n<p>\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c4\r\n\r\na = ['\u5973\u5b50\u66f4\u8863\u5ba4','\u7537\u5b50\u66f4\u8863\u5ba4','\u5973\u5b50\u66f4\u8863\u5ba4','\u66f4\u8863\u5ba4','\u5973\u5b50\u66f4\u8863\u5ba4','\u5973\u5b50\u66f4\u8863\u5ba4']\r\nb = a.count('\u7537\u5b50\u66f4\u8863\u5ba4')\r\n\r\nprint(b)<\/pre>\n<p>\u7537\u5b50\u66f4\u8863\u5ba4\u306f1\u3064\u3057\u304b\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u306a\u306e\u3067\u5b9f\u884c\u3059\u308b\u3068\u300e1\u300f\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/dansikousi812.jpg\" alt=\"count\" width=\"582\" height=\"143\" class=\"alignnone size-full wp-image-632\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/dansikousi812.jpg 582w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/dansikousi812-300x74.jpg 300w\" sizes=\"(max-width: 582px) 100vw, 582px\" \/><\/p>\n<p>\u3088\u308d\u3057\u3044\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u30ea\u30b9\u30c8\u306e\u8981\u7d20\u6570\u5168\u4f53\u3092\u53d6\u5f97\u3057\u305f\u3044\u306a\u3089<br \/>\nlen\u3092\u3001\u30ea\u30b9\u30c8\u5185\u306e\u7279\u5b9a\u306e\u8981\u7d20\u6570<span class=\"yellowbg\">\u3060\u3051<\/span>\u3092\u53d6\u5f97\u3057\u305f\u3044\u306a\u3089count\u3092<br \/>\n\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u76ee\u7684\u3092\u9054\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2><span id=\"Python-2\">\u3010Python\u3011\u30ea\u30b9\u30c8\u5185\u306e\u5fc5\u8981\u306a\u8981\u7d20\u3092\u62bd\u51fa\u3059\u308b\u65b9\u6cd5<\/span><\/h2>\n<p>\u30ea\u30b9\u30c8\u5185\u306e\u5fc5\u8981\u306a\u8981\u7d20\u3092\u62bd\u51fa\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u4f8b\u984c6\u3092\u4e00\u7dd2\u306b\u3084\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c6 \r\n\r\na = [{'place': '\u5973\u5b50\u66f4\u8863\u5ba4', 'ninzu': 25}, \r\n     {'place': '\u7537\u5b50\u66f4\u8863\u5ba4', 'ninzu': 20},\r\n     {'place': '\u30c8\u30a4\u30ec', 'ninzu': 30}]\r\nb = [e.get('place')for e in a]\r\n\r\nprint(b)<\/pre>\n<p>\u30ea\u30b9\u30c8\u306e\u4e2d\u3067\u3082\u5834\u6240\uff08place\uff09\u306b\u95a2\u4fc2\u3059\u308b\u8981\u7d20\u3060\u3051\u3092<br \/>\n\u62bd\u51fa\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>get\u3092\u4f7f\u3046\u3053\u3068\u3067\u5b9f\u73fe\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u3059\u306d\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">b = [e.get('place')for e in a]<\/pre>\n<p>\u300ein a\u300f<br \/>\n\u306f\u3001\u300e\u30ea\u30b9\u30c8a\u306e\u4e2d\u306b\u300f\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002<\/p>\n<p>\u306a\u306e\u3067<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">b = [e.get('place')for e in a]<\/pre>\n<p>\u306f\u3001\u300e\u30ea\u30b9\u30c8a\u306e\u4e2d\u306bplace\u306b\u95a2\u4fc2\u3059\u308b\u3082\u306e\u3092\u62bd\u51fa\u3057\u306a\u3055\u3044\u300f<br \/>\n\u3068\u3044\u3046\u610f\u5473\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3057\u305f\u304c\u3063\u3066\u3001\u5b9f\u884c\u3059\u308b\u3068<br \/>\n[&#8216;\u5973\u5b50\u66f4\u8863\u5ba4&#8217;, &#8216;\u7537\u5b50\u66f4\u8863\u5ba4&#8217;, &#8216;\u30c8\u30a4\u30ec&#8217;]<br \/>\n\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/pythonget812.jpg\" alt=\"get\u95a2\u6570\" width=\"565\" height=\"179\" class=\"alignnone size-full wp-image-634\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/pythonget812.jpg 565w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/pythonget812-300x95.jpg 300w\" sizes=\"(max-width: 565px) 100vw, 565px\" \/><\/p>\n<h2><span id=\"Python-3\">\u3010Python\u3011\u30ea\u30b9\u30c8\u306b\u76ee\u7684\u306e\u8981\u7d20\u304c\u5165\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3059\u308b\u65b9\u6cd5<\/span><\/h2>\n<p>\u30ea\u30b9\u30c8a\u306e\u4e2d\u306b\u300e\u7537\u5b50\u66f4\u8863\u5ba4\u300f\u304c\u5165\u3063\u3066\u305f\u304b\u306a\uff1f<br \/>\n\u3068\u601d\u3063\u305f\u3089\u3001\u300ein\u300f\u3092\u4f7f\u3046\u3053\u3068\u3067\u76ee\u7684\u3092\u9054\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306b\u3084\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c7\r\n\r\na = ['\u5973\u5b50\u66f4\u8863\u5ba4','\u7537\u5b50\u66f4\u8863\u5ba4','\u5973\u5b50\u66f4\u8863\u5ba4','\u66f4\u8863\u5ba4','\u5973\u5b50\u66f4\u8863\u5ba4','\u5973\u5b50\u66f4\u8863\u5ba4']\r\nb = '\u7537\u5b50\u66f4\u8863\u5ba4' in a\r\n\r\nprint(b)<\/pre>\n<p>\u5b9f\u969b\u306b\u300e\u7537\u5b50\u66f4\u8863\u5ba4\u300f\u3068\u3044\u3046\u8981\u7d20\u304c<br \/>\n\u30ea\u30b9\u30c8a\u306b\u5165\u3063\u3066\u3044\u308c\u3070True\u3092<br \/>\n\u5165\u3063\u3066\u3044\u306a\u3051\u308c\u3070False\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u984c7\u3067\u306f\u30ea\u30b9\u30c8a\u306e\u4e2d\u306b\u300e\u7537\u5b50\u66f4\u8863\u5ba4\u300f\u3068\u3044\u3046\u8981\u7d20\u304c\u5165\u3063\u3066\u3044\u308b\u306e\u3067<br \/>\n\u5b9f\u884c\u3059\u308b\u3068True\u304c\u8fd4\u3063\u3066\u304d\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/inkeitou812.jpg\" alt=\"in\" width=\"586\" height=\"145\" class=\"alignnone size-full wp-image-636\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/inkeitou812.jpg 586w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/inkeitou812-300x74.jpg 300w\" sizes=\"(max-width: 586px) 100vw, 586px\" \/><\/p>\n<p>\u3067\u306f\u4f8b\u984c8\u304c\u3069\u3046\u3067\u3057\u3087\u3046\uff1f<br \/>\nTrue\u304c\u8fd4\u3063\u3066\u304f\u308b\u3067\u3057\u3087\u3046\u304b\u3001<br \/>\n\u305d\u308c\u3068\u3082False\u304c\u8fd4\u3063\u3066\u304f\u308b\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c8\r\n\r\na = ['\u5973\u5b50\u66f4\u8863\u5ba4','\u7537\u5b50\u66f4\u8863\u5ba4','\u5973\u5b50\u66f4\u8863\u5ba4','\u66f4\u8863\u5ba4','\u5973\u5b50\u66f4\u8863\u5ba4','\u5973\u5b50\u66f4\u8863\u5ba4']\r\nb = '\u7537\u5b50\u30c8\u30a4\u30ec' in a\r\n\r\nprint(b)<\/pre>\n<p>\u7537\u5b50\u30c8\u30a4\u30ec\u304c\u30ea\u30b9\u30c8a\u306b\u5165\u3063\u3066\u3044\u308b\u306a\u3089True\u3092<br \/>\n\u30ea\u30b9\u30c8a\u306b\u5165\u3063\u3066\u306a\u3044\u306a\u3089False\u304c\u8fd4\u3063\u3066\u304d\u307e\u3059\u3002<\/p>\n<p>\u3067\u3001\u30ea\u30b9\u30c8a\u306b\u306f\u300e\u7537\u5b50\u30c8\u30a4\u30ec\u300f\u304c\u5165\u3063\u3066\u3044\u307e\u305b\u3093\u3002<br \/>\n\u3057\u305f\u304c\u3063\u3066\u5b9f\u884c\u3059\u308b\u3068False\u304c\u8fd4\u3063\u3066\u304d\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/dansi812.jpg\" alt=\"in\" width=\"586\" height=\"145\" class=\"alignnone size-full wp-image-638\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/dansi812.jpg 586w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/dansi812-300x74.jpg 300w\" sizes=\"(max-width: 586px) 100vw, 586px\" \/><\/p>\n<h2><span id=\"i\">\u30ea\u30b9\u30c8\u306e\u4e2d\u306b\u30ea\u30b9\u30c8\u3092\u5165\u308c\u308b\u65b9\u6cd5<\/span><\/h2>\n<p>\u4eca\u5ea6\u306f\u30ea\u30b9\u30c8\u306e\u4e2d\u306b\u30ea\u30b9\u30c8\u3092\u5165\u308c\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u4f8b\u984c8\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c8\r\n\r\na = ['\u5973\u5b50\u66f4\u8863\u5ba4','\u7537\u5b50\u66f4\u8863\u5ba4','\u66f4\u8863\u5ba4','\u5973\u5b50\u66f4\u8863\u5ba4']\r\nb = ['\u7537\u5b50\u30c8\u30a4\u30ec','\u5973\u5b50\u30c8\u30a4\u30ec','\u5171\u7528\u30c8\u30a4\u30ec']\r\nc = [a,b]\r\n\r\nprint(c)<\/pre>\n<p>\u30ea\u30b9\u30c8a\u3068\u30ea\u30b9\u30c8b\u306f<br \/>\n\u4eca\u307e\u3067\u306e\u89e3\u8aac\u3067\u308f\u304b\u3063\u3066\u3044\u305f\u3060\u3051\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u984c8\u3067\u306f\u3055\u3089\u306b\u30ea\u30b9\u30c8c\u306e\u4e2d\u306b<br \/>\n\u30ea\u30b9\u30c8a\u3068\u30ea\u30b9\u30c8b\u3092\u5165\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u5b9f\u884c\u3059\u308b\u3068<\/p>\n<p>[[&#8216;\u5973\u5b50\u66f4\u8863\u5ba4&#8217;, &#8216;\u7537\u5b50\u66f4\u8863\u5ba4&#8217;, &#8216;\u66f4\u8863\u5ba4&#8217;, &#8216;\u5973\u5b50\u66f4\u8863\u5ba4&#8217;], [&#8216;\u7537\u5b50\u30c8\u30a4\u30ec&#8217;, &#8216;\u5973\u5b50\u30c8\u30a4\u30ec&#8217;, &#8216;\u5171\u7528\u30c8\u30a4\u30ec&#8217;]]<br \/>\n\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/dansikousitu812.jpg\" alt=\"\u30ea\u30b9\u30c8\u306e\u4e2d\u306b\u30ea\u30b9\u30c8\u3092\u5165\u308c\u308b\" width=\"600\" height=\"137\" class=\"alignnone size-full wp-image-639\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/dansikousitu812.jpg 600w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/dansikousitu812-300x69.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>\u4eca\u5ea6\u306f\u4f8b\u984c8\u306b\u5165\u3063\u3066\u3044\u308b\u30ea\u30b9\u30c8\u5185\u306e\u8981\u7d20\u3092<br \/>\n\u4f8b\u984c9\u3067\u62bd\u51fa\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f\u300e\u66f4\u8863\u5ba4\u300f\u3060\u3051\u3092\u62bd\u51fa\u3057\u3066\u898b\u305b\u307e\u3059\u306d\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c9\r\n\r\na = ['\u5973\u5b50\u66f4\u8863\u5ba4','\u7537\u5b50\u66f4\u8863\u5ba4','\u66f4\u8863\u5ba4','\u5973\u5b50\u66f4\u8863\u5ba4']\r\nb = ['\u7537\u5b50\u30c8\u30a4\u30ec','\u5973\u5b50\u30c8\u30a4\u30ec','\u5171\u7528\u30c8\u30a4\u30ec']\r\nc = [a,b]\r\n\r\nd = c[0][2]\r\n\r\nprint(d)<\/pre>\n<p>\u3053\u3053\u304c\u62bd\u51fa\u306e\u30dd\u30a4\u30f3\u30c8\u3067\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">d = c[0][2]<\/pre>\n<p>c[0]\u306e\u90e8\u5206\u306f<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">c = [a,b]<\/pre>\n<p>\u3067\u3044\u3046\u3068\u3053\u308d\u306e\u5de6\u304b\u30891\u756a\u76ee\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002<br \/>\n\u306a\u306e\u3067\u30ea\u30b9\u30c8a\u304c\u8a72\u5f53\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u304b\u3089c[0][2]\u306e[2]\u306f<br \/>\n\u30ea\u30b9\u30c8a\u306e\u4e2d\u306e\u5de6\u304b\u30893\u756a\u76ee\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002<\/p>\n<p>[2]\u306f0,1,2,\u30fb\u30fb\u30fb\u3068\u306a\u308b\u306e\u3067<br \/>\n\u5de6\u304b\u30893\u756a\u76ee\u3092\u610f\u5473\u3057\u307e\u3059\u3002<\/p>\n<p>\u3057\u305f\u304c\u3063\u3066\u30ea\u30b9\u30c8a\u306e\u5de6\u304b\u30893\u756a\u76ee\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u30ea\u30b9\u30c8a\u306f<br \/>\na = [&#8216;\u5973\u5b50\u66f4\u8863\u5ba4&#8217;,&#8217;\u7537\u5b50\u66f4\u8863\u5ba4&#8217;,&#8217;\u66f4\u8863\u5ba4&#8217;,&#8217;\u5973\u5b50\u66f4\u8863\u5ba4&#8217;]<br \/>\n\u306a\u306e\u3067\u3001\u5de6\u304b\u30893\u756a\u76ee\u306f\u300e\u66f4\u8863\u5ba4\u300f\u304c\u8a72\u5f53\u3057\u307e\u3059\u3002<\/p>\n<p>\u306a\u306e\u3067\u5b9f\u884c\u3059\u308b\u3068<br \/>\n\u300e\u66f4\u8863\u5ba4\u300f\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u306d\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/kouisituchuis812.jpg\" alt=\"\u62bd\u51fa\" width=\"412\" height=\"196\" class=\"alignnone size-full wp-image-640\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/kouisituchuis812.jpg 412w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/kouisituchuis812-300x143.jpg 300w\" sizes=\"(max-width: 412px) 100vw, 412px\" \/><\/p>\n<p>\u4eca\u56de\u306e\u8a18\u4e8b\u306f\u4ee5\u4e0a\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3082\u3063\u3068\u30ea\u30b9\u30c8\u306b\u3064\u3044\u3066\u5b66\u3093\u3067\u307f\u305f\u3044\u65b9\u306f<br \/>\n\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<div class=\"linkcard\"><table border=\"1\" cellspacing=\"0\" cellpadding=\"4\"><tbody><\/tr><tr><td>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u30ea\u30b9\u30c8\u3092\u8ffd\u52a0\u3057\u305f\u308a\u7d50\u5408\u3057\u305f\u308a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002\u30ea\u30b9\u30c8\u3068\u8a00\u3046\u3088\u308a\u3001\u5358\u7d14\u306b\u6587\u5b57\u5217\u3092\u7d50\u5408\u3055\u305b\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3067\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002\u6c17\u306b\u306a\u308b\u65b9\u306f\u3054\u89a7\u304f\u3060\u3055\u3044\u3002\u305d\u308c\u3067\u306f\u672c\u984c\u306b\u5165\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002\u3010Python\u3011\u30ea\u30b9\u30c8\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9...<br><a class=\"no_icon\" href=\"https:\/\/python-introduction.com\/?p=600\">\u3010Python\u3011\u30ea\u30b9\u30c8\u3092\u8ffd\u52a0\u3057\u305f\u308a\u7d50\u5408\u3057\u305f\u308a\u3059\u308b\u65b9\u6cd5<\/a> - python\u5165\u9580\u30c9\u30c3\u30c8\u30b3\u30e0<\/td><\/tr><\/tbody><\/table><\/div>\n","protected":false},"excerpt":{"rendered":"\u3053\u306e\u8a18\u4e8b\u3067\u306fPython\u3067\u30ea\u30b9\u30c8\u306e\u8981\u7d20\u6570\u3092\u53d6\u5f97\u3057\u305f\u308a \u62bd\u51fa\u3057\u305f\u308a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002 \u30ea\u30b9\u30c8\u3092\u8ffd\u52a0\u3057\u305f\u308a\u7d50\u5408\u3057\u305f\u308a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f \u3053\u3061\u3089\u306e\u8a18\u4e8b\u3067\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002 \u3067\u306f\u672c\u984c\u306b\u5165\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046 [&hellip;]","protected":false},"author":1,"featured_media":609,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,43],"tags":[3,44,27,46],"_links":{"self":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/620"}],"collection":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=620"}],"version-history":[{"count":11,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/620\/revisions"}],"predecessor-version":[{"id":641,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/620\/revisions\/641"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/media\/609"}],"wp:attachment":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=620"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=620"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=620"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}