{"id":296,"date":"2018-08-04T14:52:08","date_gmt":"2018-08-04T05:52:08","guid":{"rendered":"https:\/\/python-introduction.com\/?p=296"},"modified":"2018-08-04T14:52:08","modified_gmt":"2018-08-04T05:52:08","slug":"%e3%80%90python%e5%85%a5%e9%96%80%e3%80%91%e6%96%87%e5%ad%97%e5%88%97%e3%82%92%e5%88%86%e5%89%b2%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%e3%82%8b%e6%96%b9","status":"publish","type":"post","link":"https:\/\/python-introduction.com\/?p=296","title":{"rendered":"\u3010python\u5165\u9580\u3011\u6587\u5b57\u5217\u3092\u5206\u5272\u3057\u305f\u308a\u62bd\u51fa\u3057\u305f\u308a\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u3053\u306e\u8a18\u4e8b\u3067\u306fpython\u4e0a\u3067\u4f7f\u7528\u3059\u308b\u6587\u5b57\u5217\u3092\u5206\u5272\u3057\u305f\u308a<br \/>\n\u62bd\u51fa\u3057\u305f\u308a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<p>\u6587\u5b57\u5217\u64cd\u4f5c\u306e\u57fa\u672c\u306b\u3064\u3044\u3066\u306f<br \/>\n\u3053\u3061\u3089\u3067\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u306e\u3067\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\u306fpython\u7279\u6709\u306e\u6587\u5b57\u5217\u64cd\u4f5c\u306b\u3064\u3044\u3066\u307e\u3068\u3081\u3066\u307f\u307e\u3057\u305f\u3002\u3082\u3057\u6587\u5b57\u5217\u64cd\u4f5c\u3067\u306a\u304f\u3001\u6570\u5024\u8a08\u7b97\u306b\u3064\u3044\u3066\u77e5\u308a\u305f\u3044\u65b9\u306f\u30b3\u30c1\u30e9\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002python\u306b\u304a\u3051\u308b\u6587\u5b57\u5217\u64cd\u4f5c\u306e\u57fa\u672cpython\u3067\u6587\u5b57\u5217\u3092\u6271\u3046\u3068\u304d\u306b\u306f\u300e&#039;\uff08\u30b7\u30f3\u30b0\u30eb\u30af\u30aa\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\uff09\u300f\u3067\u3082\u300e&quot;...<br><a class=\"no_icon\" href=\"https:\/\/python-introduction.com\/?p=213\">python\u7279\u6709\u306e\u6587\u5b57\u5217\u64cd\u4f5c\u307e\u3068\u3081<\/a> - python\u5165\u9580\u30c9\u30c3\u30c8\u30b3\u30e0<\/td><\/tr><\/tbody><\/table><\/div>\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\u5165\u9580\u3011\u6587\u5b57\u5217\u3092\u5206\u5272\u3057\u3066\u8868\u793a\u3059\u308b\u65b9\u6cd5<\/a><\/li><li><a href=\"#python-2\"><span class=\"toc_number toc_depth_1\">2<\/span> python\u6587\u5b57\u5217\u62bd\u51fa\uff1a\u30b9\u30e9\u30a4\u30b9<\/a><\/li><li><a href=\"#pythonlen\"><span class=\"toc_number toc_depth_1\">3<\/span> python\u306elen\u95a2\u6570\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u306e\u9577\u3055\u3092\u8abf\u3079\u308b<\/a><\/li><\/ul><\/div>\n<h2><span id=\"python\">\u3010python\u5165\u9580\u3011\u6587\u5b57\u5217\u3092\u5206\u5272\u3057\u3066\u8868\u793a\u3059\u308b\u65b9\u6cd5<\/span><\/h2>\n<p>\u305f\u3068\u3048\u3070\u3001<br \/>\n<span class=\"redb18\">\u300c\u304a\u3070\u3042\u3061\u3083\u3093\u3001\u5927\u597d\u304d\u3060\u3088\u300d<\/span><br \/>\n\u3067\u300e\u3070\u300f\u3060\u3051\u5206\u5272\u3057\u3066\u8868\u793a\u3055\u305b\u305f\u3044\u3068\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u300c\u304a\u3070\u3042\u3061\u3083\u3093\u3001\u5927\u597d\u304d\u3060\u3088\u300d\u3092\u5168\u90e8\u8868\u793a\u3055\u305b\u308b\u306a\u3089<br \/>\n\u3053\u3046\u306a\u308a\u307e\u3059\u306d\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">print('\u300c\u304a\u3070\u3042\u3061\u3083\u3093\u3001\u5927\u597d\u304d\u3060\u3088\u300d')<\/pre>\n<p>\u5b9f\u884c\u3059\u308b\u3068\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-300\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/kihonnteki803.jpg\" alt=\"\u6587\u5b57\u5217\u64cd\u4f5c\" width=\"456\" height=\"188\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/kihonnteki803.jpg 456w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/kihonnteki803-300x124.jpg 300w\" sizes=\"(max-width: 456px) 100vw, 456px\" \/><\/p>\n<p>\u3067\u306f\u6b21\u306b\u300e\u3070\u300f\u3060\u3051\u8868\u793a\u3055\u305b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><span class=\"marker_kpink\">\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u3044\u307e\u3059\u3002<\/span><\/p>\n<p>\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u3046\u306b\u306f\u307e\u305a\u5909\u6570\u306b<br \/>\n\u300c\u304a\u3070\u3042\u3061\u3083\u3093\u3001\u5927\u597d\u304d\u3060\u3088\u300d\u3092\u5165\u308c\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3053\u3053\u3067\u306fa\u306b\u5165\u308c\u307e\u3059\u306d\u3002<\/p>\n<p>\u5909\u6570\u306e\u3053\u3068\u304c\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u65b9\u306f<br \/>\n\u30b3\u30c1\u30e9\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\u306fPythonn\u306e\u5909\u6570\u5ba3\u8a00\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u8a18\u4e8b\u306fPycharm\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002\u307e\u3060\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u306a\u3044\u65b9\u306f\u30b3\u30c1\u30e9\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002Pycharm\u306e\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066\u77e5\u308a\u305f\u3044\u65b9\u306f\u3053\u3061\u3089\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002\u307e\u305a\u4ee5\u4e0b\u3092\u5165\u529b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002 num = 91name =&#039;P...<br><a class=\"no_icon\" href=\"https:\/\/python-introduction.com\/?p=145\">Python\u306e\u5909\u6570\u5ba3\u8a00\u3067\u6ce8\u610f\u3059\u3079\u304d\u3053\u3068<\/a> - python\u5165\u9580\u30c9\u30c3\u30c8\u30b3\u30e0<\/td><\/tr><\/tbody><\/table><\/div>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">a = '\u304a\u3070\u3042\u3061\u3083\u3093\u3001\u5927\u597d\u304d\u3060\u3088'\r\nprint(a[1])\r\n<\/pre>\n<p>\u4e0a\u8a18\u306e\u3088\u3046\u306b\u5909\u6570a\u306b[1]\u3068\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u3059\u308b\u3068\u30012\u756a\u76ee\u306e\u6587\u5b57\u3060\u3051\u5206\u5272\u3057\u3066\u8868\u793a\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-302\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/bdake803.jpg\" alt=\"\u5206\u5272\" width=\"462\" height=\"189\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/bdake803.jpg 462w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/bdake803-300x123.jpg 300w\" sizes=\"(max-width: 462px) 100vw, 462px\" \/><\/p>\n<p>\u300c\u304a\u3070\u3042\u3061\u3083\u3093\u306e\u300e\u3070\u300f\u306f2\u756a\u76ee\u3060\u304b\u3089a[2]\u3058\u3083\u306a\u3044\u306e\uff1f\u300d<br \/>\n\u3068\u601d\u308f\u308c\u305f\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u3067\u3059\u304c<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">a = '\u304a\u3070\u3042\u3061\u3083\u3093\u3001\u5927\u597d\u304d\u3060\u3088'\r\nprint(a[2])<\/pre>\n<p>\u3068\u3059\u308b\u3068<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-303\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/adake803.jpg\" alt=\"\u5206\u5272\" width=\"500\" height=\"197\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/adake803.jpg 500w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/adake803-300x118.jpg 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<p>\u304a\u3070\u3042\u3061\u3083\u3093\u306e3\u756a\u76ee\u306e\u6587\u5b57\u300e\u3042\u300f\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3069\u3046\u3044\u3046\u3053\u3068\u304b\u3068\u3044\u3046\u3068<br \/>\na[]\u306b\u5165\u308b\u6570\u5b57\u306e\u6700\u521d\u306f0\u3060\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>0,1,2\u30fb\u30fb\u30fb<br \/>\n\u3068\u306a\u3063\u3066\u3044\u308b\u3093\u3067\u3059\u3002<\/p>\n<p>\u3060\u304b\u3089\u304a\u3070\u3042\u3061\u3083\u3093\u306e\u300c\u3070\u300d\u3067\u3042\u308b2\u756a\u76ee\u306e\u6587\u5b57\u3092\u8868\u793a\u3055\u305b\u305f\u3044\u306a\u3089<br \/>\na[1]\u306b\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<p>\u3058\u3083\u3001\u300e\u304a\u3070\u3042\u3061\u3083\u3093\u300f\u306e\u300e\u304a\u300f\u3092\u8868\u793a\u3055\u305b\u308b\u306b\u306f<br \/>\n\u3069\u3046\u3059\u308c\u3070\u3088\u3044\u3067\u3057\u3087\u3046\uff1f<\/p>\n<p>a[0]\u3068\u3059\u308c\u3070\u3088\u3044\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">a = '\u304a\u3070\u3042\u3061\u3083\u3093\u3001\u5927\u597d\u304d\u3060\u3088'\r\nprint(a[0])<\/pre>\n<p>\u3059\u308b\u3068<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-340\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/obaacaho804.jpg\" alt=\"\u304a\u3070\u3042\u3061\u3083\u3093\u306e\u304a\" width=\"332\" height=\"256\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/obaacaho804.jpg 332w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/obaacaho804-300x231.jpg 300w\" sizes=\"(max-width: 332px) 100vw, 332px\" \/><\/p>\n<p>\u304a\u3070\u3042\u3061\u3083\u3093\u306e\u300e\u304a\u300f\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u6b21\u306b\u300c\u304a\u3070\u3042\u3061\u3083\u3093\u3001\u5927\u597d\u304d\u3060\u3088\u300d\u306e\u6700\u5f8c\u306e\u300e\u3088\u300f\u3092\u8868\u793a\u3055\u305b\u308b\u306b\u306f<br \/>\n\u3069\u3046\u3059\u308c\u3070\u3088\u3044\u3067\u3057\u3087\u3046\uff1f<\/p>\n<p>\u521d\u3081\u306e\u6587\u5b57\u300e\u304a\u300f\u3092\u300e0\u300f\u3068\u3057\u3066<\/p>\n<p>\u6570\u3048\u3066\u3082\u3088\u3044\u306e\u3067\u3059\u304c\u30fb\u30fb\u30fb<\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">a = '\u304a\u3070\u3042\u3061\u3083\u3093\u3001\u5927\u597d\u304d\u3060\u3088'\r\nprint(a[11])<\/pre>\n<p>\u3061\u3083\u3093\u3068\u300e\u3088\u300f\u304c\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\/yogaderu804.jpg\" alt=\"\u3088\u3092\u8868\u793a\" width=\"335\" height=\"224\" class=\"alignnone size-full wp-image-342\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/yogaderu804.jpg 335w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/yogaderu804-300x201.jpg 300w\" sizes=\"(max-width: 335px) 100vw, 335px\" \/><\/p>\n<p>\u9762\u5012\u3067\u3059\u306d\u3002<br \/>\n\u300c\u304a\u3070\u3042\u3061\u3083\u3093\u300d\u306e\u300c\u304a\u300d\u3092\u300c0\u300d\u3068\u3057\u3066<br \/>\n11\u756a\u76ee\u306e\u300c\u3088\u300d\u307e\u3067\u4e00\u3005\u6570\u3048\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093\u304b\u3089\u3002<\/p>\n<p>\u3082\u3063\u3068\u7c21\u5358\u306b\u8868\u793a\u3067\u304d\u308b\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>a[-1]\u3068\u30de\u30a4\u30ca\u30b9\u306b\u3059\u308c\u3070\u3044\u3044\u3093\u3067\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">a = '\u304a\u3070\u3042\u3061\u3083\u3093\u3001\u5927\u597d\u304d\u3060\u3088'\r\nprint(a[-1])<\/pre>\n<p>\u304d\u3061\u3093\u3068\u300e\u3088\u300f\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u306d\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/tohhh804.jpg\" alt=\"\u6587\u5b57\u5217\u64cd\u4f5c\" width=\"512\" height=\"289\" class=\"alignnone size-full wp-image-344\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/tohhh804.jpg 512w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/tohhh804-300x169.jpg 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/p>\n<p>\u3067\u306f[-2]\u306a\u3089\u3069\u3046\u306a\u308b\u3067\u3057\u3087\u3046\uff1f<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">a = '\u304a\u3070\u3042\u3061\u3083\u3093\u3001\u5927\u597d\u304d\u3060\u3088'\r\nprint(a[-2])<\/pre>\n<p>\u6700\u5f8c\u304b\u30892\u756a\u76ee\u306e\u300e\u3060\u300f\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/ssss804.jpg\" alt=\"\u6587\u5b57\u5217\u64cd\u4f5c\" width=\"505\" height=\"309\" class=\"alignnone size-full wp-image-346\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/ssss804.jpg 505w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/ssss804-300x184.jpg 300w\" sizes=\"(max-width: 505px) 100vw, 505px\" \/><\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067<span class=\"yellowbg\">\u6587\u5b57\u5217\u306e\u5de6\u304b\u3089\u53f3\u3092\u6570\u3048\u308b\u3068\u304d\u306f[0]\u304b\u3089<br \/>\n\u53f3\u304b\u3089\u5de6\u306b\u6570\u3048\u308b\u3068\u304d\u306f[-1]\u304b\u3089\u6570\u3048\u308b\u3053\u3068\u3067<br \/>\n\u76ee\u7684\u306e\u6587\u5b57\u3060\u3051\u3092\u8868\u793a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059<\/span>\u3002<\/p>\n<h2><span id=\"python-2\">python\u6587\u5b57\u5217\u62bd\u51fa\uff1a\u30b9\u30e9\u30a4\u30b9<\/span><\/h2>\n<p>python\u3067\u6587\u5b57\u5217\u3092\u62bd\u51fa\u3055\u305b\u305f\u3044\u3068\u304d\u3001<br \/>\n\u30b9\u30e9\u30a4\u30b9\u3092\u4f7f\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070<br \/>\n<span class=\"redb18\">\u300e\u6587\u5b57\u5217\u306e\u62bd\u51fa\u3084\u5206\u5272\u306f\u7c21\u5358\u3060\u300f<\/span><br \/>\n\u3068\u3044\u3046\u6587\u7ae0\u304c\u3042\u3063\u305f\u3068\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u3001\u300e\u62bd\u51fa\u300f\u3068\u3044\u3046\u5358\u8a9e\u3060\u3051\u3092\u62bd\u51fa\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u6d12\u843d\u3067\u306f\u306a\u3044\u3067\u3059\u3088\uff08\u82e6\u7b11\uff09<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">a = '\u6587\u5b57\u5217\u306e\u62bd\u51fa\u3084\u5206\u5272\u306f\u7c21\u5358\u3060'\r\nprint(a[4:6])<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306ba[\u62bd\u51fa\u3057\u305f\u3044\u6587\u5b57:\u62bd\u51fa\u3057\u305f\u3044\u6700\u5f8c\u306e\u6587\u5b57\u306e\u6b21\u306e\u6587\u5b57]<br \/>\n\u3067\u3001\u5fc5\u8981\u306a\u6587\u5b57\u3060\u3051\u3092\u62bd\u51fa\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/chuushutu804.jpg\" alt=\"\u30b9\u30e9\u30a4\u30b9\u3067\u6587\u5b57\u5217\u3092\u62bd\u51fa\" width=\"491\" height=\"304\" class=\"alignnone size-full wp-image-348\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/chuushutu804.jpg 491w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/chuushutu804-300x186.jpg 300w\" sizes=\"(max-width: 491px) 100vw, 491px\" \/><\/p>\n<p>(a[4:6])\u3067\u30014\u306f0\u304b\u3089\u6570\u3048\u30665\u756a\u76ee\u306e\u300e\u62bd\u300f\u3092\u3002<br \/>\n6\u306f0\u304b\u3089\u6570\u3048\u30667\u756a\u76ee\u306e\u300e\u3084\u300f\u306e\u624b\u524d\u307e\u3067\u3092\u610f\u5473\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3060\u304b\u3089(a[4:6])\u3068\u3059\u308b\u3053\u3068\u3067\u300e\u62bd\u51fa\u300f\u3060\u3051\u304c<br \/>\n\u62bd\u51fa\u3055\u308c\u308b\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<p>\u3053\u308c\u3092\u30b9\u30e9\u30a4\u30b9\u3068\u3044\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u4f8b\u984c\u3092\u3002<br \/>\n\u5b9f\u969b\u306b\u3084\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u300e\u6587\u5b57\u5217\u306e\u62bd\u51fa\u3084\u5206\u5272\u306f\u7c21\u5358\u3060\u300f<\/p>\n<p>\u3067\u3001\u300e\u5206\u5272\u306f\u7c21\u5358\u300f\u3060\u3051\u3092\u62bd\u51fa\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3069\u3046\u3059\u308c\u3070\u3088\u3044\u3067\u3057\u3087\u3046\uff1f<br \/>\n\u5b9f\u969b\u306b\u3084\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u56de\u7b54\u306f\u30fb\u30fb\u30fb<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">a = '\u6587\u5b57\u5217\u306e\u62bd\u51fa\u3084\u5206\u5272\u306f\u7c21\u5358\u3060'\r\nprint(a[7:12])<\/pre>\n<p>\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/chuushutuhakantan804.jpg\" alt=\"\u5206\u5272\u306f\u7c21\u5358\" width=\"490\" height=\"292\" class=\"alignnone size-full wp-image-350\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/chuushutuhakantan804.jpg 490w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/chuushutuhakantan804-300x179.jpg 300w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/chuushutuhakantan804-320x190.jpg 320w\" sizes=\"(max-width: 490px) 100vw, 490px\" \/><\/p>\n<p>(a[7:12])\u3067\u30017\u306f\u300e\u5206\u300f\u309212\u306f\u300e\u3060\u300f\u306e\u624b\u524d\u307e\u3067\u3092\u610f\u5473\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u554f\u984c\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5834\u5408\u3001\u5b9f\u884c\u3057\u305f\u3089<br \/>\n\u3069\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u308b\u3067\u3057\u3087\u3046\uff1f<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">a = '\u6587\u5b57\u5217\u306e\u62bd\u51fa\u3084\u5206\u5272\u306f\u7c21\u5358\u3060'\r\nprint(a[:6])<\/pre>\n<p>\u4e0a\u8a18\u306e\u554f\u984c\u306f(a[:6])\u3068<br \/>\n:6\u306e\u524d\u306b\u6570\u5b57\u304c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u7d50\u8ad6\u306f\u3053\u3046\u3067\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/mojidatuuu804.jpg\" alt=\"\u6587\u5b57\u5217\u306e\u62bd\u51fa\" width=\"508\" height=\"318\" class=\"alignnone size-full wp-image-352\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/mojidatuuu804.jpg 508w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/mojidatuuu804-300x188.jpg 300w\" sizes=\"(max-width: 508px) 100vw, 508px\" \/><\/p>\n<p>(a[:6])\u3068\u3057\u305f\u5834\u5408\u3001\u6570\u5b57\u3092\u7a7a\u767d\u306b\u3057\u3066\u3044\u308b\u90e8\u5206\u306f\u300e0\u300f\u3068<br \/>\npython\u3067\u306f\u8a8d\u8b58\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">a = '\u6587\u5b57\u5217\u306e\u62bd\u51fa\u3084\u5206\u5272\u306f\u7c21\u5358\u3060'\r\nprint(a[7:])<\/pre>\n<p>\u3060\u3063\u305f\u3089\u3069\u3046\u3044\u3046\u7d50\u679c\u306b\u306a\u308b\u3067\u3057\u3087\u3046\uff1f<\/p>\n<p>(a[7:])\u3068\u5de6\u5074\u306b\u306f7\u3068\u3044\u3046\u6570\u5b57\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u3067\u3082\u53f3\u5074\u306b\u306f\u6570\u5b57\u304c\u5165\u3063\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n<p>\u52d8\u306e\u3044\u3044\u65b9\u306f\u308f\u304b\u308b\u3067\u3057\u3087\u3046\u306d\u3002<\/p>\n<p>\u7d50\u8ad6\u306f\u3053\u3046\u3067\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/kannnoiiii804.jpg\" alt=\"\u5206\u5272\u306f\u7c21\u5358\" width=\"494\" height=\"318\" class=\"alignnone size-full wp-image-353\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/kannnoiiii804.jpg 494w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/kannnoiiii804-300x193.jpg 300w\" sizes=\"(max-width: 494px) 100vw, 494px\" \/><\/p>\n<p>(a[7:])\u3068\u53f3\u5074\u306b\u6570\u5b57\u304c\u306a\u3044\u5834\u5408\u306b\u306f<br \/>\n\u6587\u5b57\u5217\u306e\u6700\u5f8c\u307e\u3067\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3058\u3083\u3001\u3053\u308c\u306a\u3089\u3069\u3046\u306a\u308b\u3067\u3057\u3087\u3046\uff1f<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">a = '\u6587\u5b57\u5217\u306e\u62bd\u51fa\u3084\u5206\u5272\u306f\u7c21\u5358\u3060'\r\nprint(a[:])<\/pre>\n<p>\u6587\u5b57\u5217\u306e\u6700\u521d\u304b\u3089\u6700\u5f8c\u307e\u3067\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u306d\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/mojidatuu804.jpg\" alt=\"\u6587\u5b57\u5217\u306e\u6700\u521d\u304b\u3089\u6700\u5f8c\u307e\u3067\" width=\"522\" height=\"305\" class=\"alignnone size-full wp-image-355\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/mojidatuu804.jpg 522w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/mojidatuu804-300x175.jpg 300w\" sizes=\"(max-width: 522px) 100vw, 522px\" \/><\/p>\n<h2><span id=\"pythonlen\">python\u306elen\u95a2\u6570\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u306e\u9577\u3055\u3092\u8abf\u3079\u308b<\/span><\/h2>\n<p><span class=\"redb18\">\u300e\u304a\u3058\u3044\u3061\u3083\u3093\u306f\u6b4c\u304c\u30df\u30b9\u30c1\u30eb\u306e\u685c\u4e95\u3055\u3093\u304f\u3089\u3044\u4e0a\u624b\u300f<\/span><br \/>\n\u3068\u3044\u3046\u6587\u5b57\u5217\u304c\u3042\u3063\u305f\u3068\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u6587\u5b57\u5217\u306e\u9577\u3055\u3092\u8abf\u3079\u308b\u3068\u304d\u306b\u306f<br \/>\nlen\u95a2\u6570\u3092\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3053\u3046\u3084\u3063\u3066\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">a = '\u304a\u3058\u3044\u3061\u3083\u3093\u306f\u6b4c\u304c\u30df\u30b9\u30c1\u30eb\u306e\u685c\u4e95\u3055\u3093\u304f\u3089\u3044\u4e0a\u624b'\r\nb = len(a)\r\n\r\nprint(b)<\/pre>\n<p>\u5b9f\u884c\u3059\u308b\u3068\u7d50\u679c\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/lenkansuu804.jpg\" alt=\"len\u95a2\u6570\" width=\"497\" height=\"352\" class=\"alignnone size-full wp-image-357\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/lenkansuu804.jpg 497w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/lenkansuu804-300x212.jpg 300w\" sizes=\"(max-width: 497px) 100vw, 497px\" \/><\/p>\n<p>\u6587\u5b57\u6570\u304c23\u6587\u5b57\u3063\u3066\u3053\u3068\u3067\u3059\u306d\u3002<\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067len\u95a2\u6570\u3092\u4f7f\u3046\u3053\u3068\u3067<br \/>\n\u6587\u5b57\u5217\u306e\u9577\u3055\u3092\u8abf\u3079\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0a\u3067\u89e3\u8aac\u3092\u7d42\u308f\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u3053\u306e\u8a18\u4e8b\u3067\u306fpython\u4e0a\u3067\u4f7f\u7528\u3059\u308b\u6587\u5b57\u5217\u3092\u5206\u5272\u3057\u305f\u308a \u62bd\u51fa\u3057\u305f\u308a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002 \u6587\u5b57\u5217\u64cd\u4f5c\u306e\u57fa\u672c\u306b\u3064\u3044\u3066\u306f \u3053\u3061\u3089\u3067\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3054\u89a7\u304f\u3060\u3055\u3044\u3002 \u76ee\u6b211 \u3010python\u5165\u9580\u3011\u6587\u5b57\u5217\u3092\u5206\u5272\u3057\u3066\u8868\u793a [&hellip;]","protected":false},"author":1,"featured_media":297,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,21],"tags":[3,26,27,25],"_links":{"self":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/296"}],"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=296"}],"version-history":[{"count":13,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/296\/revisions"}],"predecessor-version":[{"id":358,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/296\/revisions\/358"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/media\/297"}],"wp:attachment":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}