{"id":1262,"date":"2018-10-13T22:43:50","date_gmt":"2018-10-13T13:43:50","guid":{"rendered":"https:\/\/python-introduction.com\/?p=1262"},"modified":"2018-10-13T22:43:50","modified_gmt":"2018-10-13T13:43:50","slug":"%e3%80%90python%e5%85%a5%e9%96%80%e3%80%91range%e9%96%a2%e6%95%b0%e3%81%a7for%e6%96%87%e3%81%ae%e9%9d%a2%e5%80%92%e3%81%aa%e8%a8%98%e8%bf%b0%e3%81%8b%e3%82%89%e8%a7%a3%e6%94%be%e3%81%95%e3%82%8c","status":"publish","type":"post","link":"https:\/\/python-introduction.com\/?p=1262","title":{"rendered":"\u3010Python\u5165\u9580\u3011range\u95a2\u6570\u3067for\u6587\u306e\u9762\u5012\u306a\u8a18\u8ff0\u304b\u3089\u89e3\u653e\u3055\u308c\u3088\u3046"},"content":{"rendered":"<p>\u3053\u3053\u307e\u3067\u306e\u8a18\u4e8b\u3067for\u6587\u306b\u3064\u3044\u3066<br \/>\n\u304b\u306a\u308a\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u6c17\u306b\u306a\u308b\u8a18\u4e8b\u304c\u3042\u308a\u307e\u3057\u305f\u3089<br \/>\n\u3053\u3061\u3089\u304b\u3089\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=768\" target=\"blank\">\u3010Python\u3011for\u6587\u306e\u66f8\u304d\u65b9\u3092\u8ab0\u3067\u3082\u308f\u304b\u308b\u3088\u3046\u306b\u89e3\u8aac<\/a><br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=811\" target=\"blank\">\u3010Python\u3011for\u6587\u4e2d\u3067\u52b9\u679c\u7684\u306bbreak\u3068continue\u3092\u4f7f\u3046\u65b9\u6cd5<\/a><\/p>\n<p>\u3067\u306f\u672c\u984c\u306b\u5165\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u4eca\u56de\u306frange\u95a2\u6570\u306b\u3064\u3044\u3066\u3067\u3059\u3002<br \/>\n\u7279\u306bfor\u6587\u4e2d\u3067\u4f7f\u3046range\u95a2\u6570\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h2>\u3010Python\u5165\u9580\u3011for\u6587\u306e\u9762\u5012\u306a\u8a18\u8ff0\u3082range\u95a2\u6570\u3092\u4f7f\u3048\u3070\u7c21\u5358\u306b\u306a\u308b<\/h2>\n<p>\u307e\u305a\u4f8b\u984c1\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c1\r\n\r\nnum_list = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]\r\nfor x in num_list:\r\n    print(x)<\/pre>\n<p>\u5b9f\u884c\u3059\u308b\u3068\u3001<\/p>\n<div class=\"boxstyle01\">0<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n4<br \/>\n5<br \/>\n6<br \/>\n7<br \/>\n8<br \/>\n9<br \/>\n10<br \/>\n11<br \/>\n12<br \/>\n13<br \/>\n14<br \/>\n15<\/div>\n<p>\u3068\u30010\u304b\u308915\u307e\u3067\u306e\u6570\u5b57\u304c\u7f85\u5217\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067for\u6587\u3092\u4f7f\u3046\u3053\u3068\u3067<br \/>\n\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3067\u3082\u3001\u3044\u3061\u3044\u3061\u3001list\u3068\u3057\u30660\u304b\u308915\u307e\u3067\u306e\u6570\u5b57\u3092\u5165\u529b\u3057\u3066<br \/>\nfor\u6587\u3092\u4f7f\u3063\u3066\u3001\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u3092\u5229\u7528\u3057\u3066<br \/>\n\u6570\u5b57\u3092\u8868\u793a\u3055\u305b\u308b\u306e\u3063\u3066\u9762\u5012\u304f\u3055\u3044\u3067\u3059\u3088\u306d\u3002<\/p>\n<p>\u305d\u3093\u306a\u3053\u3068\u3082\u3042\u3063\u3066Python\u306b\u306frange\u95a2\u6570\u3068\u3044\u3046\u3082\u306e\u304c<br \/>\n\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>rnge\u95a2\u6570\u3092\u4f7f\u3063\u3066\u30010\u304b\u308915\u307e\u3067\u306e\u6570\u5b57\u3092\u8868\u793a\u3055\u305b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u4f8b\u984c2\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c2\r\n\r\nfor x in range(16):\r\n    print(x)<\/pre>\n<p>\u4f8b\u984c2\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001<\/p>\n<div class=\"boxstyle01\">0<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n4<br \/>\n5<br \/>\n6<br \/>\n7<br \/>\n8<br \/>\n9<br \/>\n10<br \/>\n11<br \/>\n12<br \/>\n13<br \/>\n14<br \/>\n15<\/div>\n<p>\u3068\u3001\u4f8b\u984c1\u3068\u307e\u3063\u305f\u304f\u540c\u3058\u7d50\u679c\u3068\u306a\u308a\u307e\u3057\u305f\u306d\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">for x in range(16):<\/pre>\n<p>\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001range(16)\u3068\u3059\u308b\u3068\u3001<br \/>\n0\u304b\u308916\u306e1\u500b\u624b\u524d\u306e\u6570\u5b57\u3067\u3042\u308b15\u307e\u3067\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u300c\u3058\u3083\u30013\u304b\u308915\u307e\u3067\u8868\u793a\u3055\u305b\u308b\u3093\u3060\u3063\u305f\u3089<br \/>\n\u3069\u3046\u3057\u305f\u3089\u3044\u3044\u306e\uff1f\u300d\u3068\u601d\u3063\u305f\u65b9\u3082\u3044\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u305d\u3093\u306a\u5834\u5408\u306b\u306f\u4f8b\u984c3\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c3\r\n\r\nfor x in range(3, 16):\r\n    print(x)<\/pre>\n<p>\u3068\u3001\u8a18\u8ff0\u3059\u308c\u3070OK\u3067\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">for x in range(3, 16):<\/pre>\n<p>\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u306d\u3002<\/p>\n<p>range(3, 16)\u3068\u3001\u6700\u521d\u306e3\u306f\u6700\u521d\u306b\u8868\u793a\u3055\u308c\u308b\u6570\u5b57\u304c\u6307\u5b9a\u3055\u308c<br \/>\n\u6b21\u306e16\u306b\u3088\u3063\u3066\u300116\u306e1\u500b\u624b\u524d\u306e15\u307e\u3067\u306e\u7bc4\u56f2\u304c\u6307\u5b9a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u306a\u306e\u3067\u4f8b\u984c3\u3092\u5b9f\u884c\u3059\u308b\u3068<\/p>\n<div class=\"boxstyle01\">3<br \/>\n4<br \/>\n5<br \/>\n6<br \/>\n7<br \/>\n8<br \/>\n9<br \/>\n10<br \/>\n11<br \/>\n12<br \/>\n13<br \/>\n14<br \/>\n15<\/div>\n<p>\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u300c\u4eca\u5ea6\u306f\u30014\u500b\u98db\u3070\u3057\u3067\u6570\u5b57\u3092\u8868\u793a\u3055\u305b\u305f\u3044\u3093\u3067\u3059\u3051\u3069\u30fb\u30fb\u30fb\u300d<br \/>\n\u3068\u601d\u3063\u305f\u3089\u3001\u4f8b\u984c4\u306e\u3088\u3046\u306b\u3059\u308c\u3070OK\u3067\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c4\r\n\r\nfor x in range(3, 16, 4):\r\n    print(x)<\/pre>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">for x in range(3, 16, 4):<\/pre>\n<p>\u3068\u8a18\u8ff0\u3059\u308c\u30704\u500b\u98db\u3070\u3057\u3067\u6570\u5b57\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>range(3, 16, 4)\u306e3\u306816\u306f\u4f8b\u984c3\u3067\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002<br \/>\n\u6b21\u306e4\u304c4\u500b\u98db\u3070\u3057\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002<\/p>\n<p>\u5b9f\u884c\u3059\u308b\u3068<\/p>\n<div class=\"boxstyle01\">3<br \/>\n7<br \/>\n11<br \/>\n15<\/div>\n<p>\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>\u3010Python\u5165\u9580\u3011for range\u95a2\u6570\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u3092\u7e70\u308a\u8fd4\u3057\u8868\u793a\u3055\u305b\u3066\u307f\u308b<\/h2>\n<p>\u5148\u307b\u3069\u306f\u6570\u5b57\u3092\u7e70\u308a\u8fd4\u3057\u8868\u793a\u3055\u305b\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306e\u89e3\u8aac\u3092\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u4eca\u5ea6\u306frange\u95a2\u6570\u3092\u4f7f\u3063\u3066<br \/>\n5\u56de\u300c\u3054\u3081\u3093\u306a\u3055\u3044\u300d\u3068\u8868\u793a\u3055\u305b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u4f8b\u984c5\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c5\r\n\r\nfor x in range(5):\r\n    print('\u3054\u3081\u3093\u306a\u3055\u3044')<\/pre>\n<p>\u5b9f\u884c\u3059\u308b\u3068<\/p>\n<div class=\"boxstyle01\">\u3054\u3081\u3093\u306a\u3055\u3044<br \/>\n\u3054\u3081\u3093\u306a\u3055\u3044<br \/>\n\u3054\u3081\u3093\u306a\u3055\u3044<br \/>\n\u3054\u3081\u3093\u306a\u3055\u3044<br \/>\n\u3054\u3081\u3093\u306a\u3055\u3044<\/div>\n<p>\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u304b\u3089\u4f8b\u984c6\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u3066\u307f\u308b\u3068\u30fb\u30fb\u30fb<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n#\u4f8b\u984c6\r\n\r\nfor x in range(5):\r\n    print(x, '\u3054\u3081\u3093\u306a\u3055\u3044')<\/pre>\n<div class=\"boxstyle01\">0 \u3054\u3081\u3093\u306a\u3055\u3044<br \/>\n1 \u3054\u3081\u3093\u306a\u3055\u3044<br \/>\n2 \u3054\u3081\u3093\u306a\u3055\u3044<br \/>\n3 \u3054\u3081\u3093\u306a\u3055\u3044<br \/>\n4 \u3054\u3081\u3093\u306a\u3055\u3044<\/div>\n<p>\u4f8b\u984c4\u307e\u3067\u3067\u3084\u3063\u3066\u304d\u305f\u6570\u5b57\u306e\u8868\u793a\u3068\u300e\u3054\u3081\u3093\u306a\u3055\u3044\u300f<br \/>\n\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\"> print(x, '\u3054\u3081\u3093\u306a\u3055\u3044')<\/pre>\n<p>\u306ex\u3067\u6570\u5b57\u304c&#8217;\u3054\u3081\u3093\u306a\u3055\u3044&#8217;\u3068\u3044\u3046\u6587\u5b57\u5217\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b<br \/>\n\u8a18\u8ff0\u3057\u305f\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306frange\u95a2\u6570\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u3053\u3053\u307e\u3067\u306e\u8a18\u4e8b\u3067for\u6587\u306b\u3064\u3044\u3066 \u304b\u306a\u308a\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u304d\u307e\u3057\u305f\u3002 \u6c17\u306b\u306a\u308b\u8a18\u4e8b\u304c\u3042\u308a\u307e\u3057\u305f\u3089 \u3053\u3061\u3089\u304b\u3089\u3054\u89a7\u304f\u3060\u3055\u3044\u3002 \u21d2\u3010Python\u3011for\u6587\u306e\u66f8\u304d\u65b9\u3092\u8ab0\u3067\u3082\u308f\u304b\u308b\u3088\u3046\u306b\u89e3\u8aac \u21d2\u3010Python\u3011for\u6587\u4e2d\u3067\u52b9\u679c\u7684\u306bb [&hellip;]","protected":false},"author":1,"featured_media":1004,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[58,16],"tags":[3,131],"_links":{"self":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1262"}],"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=1262"}],"version-history":[{"count":4,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1262\/revisions"}],"predecessor-version":[{"id":1268,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1262\/revisions\/1268"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/media\/1004"}],"wp:attachment":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}