{"id":38720,"date":"2016-10-28T19:22:43","date_gmt":"2016-10-29T00:22:43","guid":{"rendered":"http:\/\/sierrablogsite.wordpress.com\/?p=508"},"modified":"2016-10-28T19:22:43","modified_gmt":"2016-10-29T00:22:43","slug":"range","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/range\/","title":{"rendered":"Range!"},"content":{"rendered":"<p class=\"syndicated-attribution\"><em> --Originally published at <a href=\"https:\/\/sierrablogsite.wordpress.com\/2016\/10\/29\/range\/\"><a href=\"https:\/\/sierrablogsite.wordpress.com\">Sierra&amp;#039;s Blog<\/a><\/a><\/em><br \/><\/p>\n<p>I&#8217;ve used in others posts the range function but I have never explained it.<\/p>\n<p>The range function is a python predeterminated function that creates a list and are principaly used in loops.<\/p>\n<p>There are different ways of using the range functions, here are them:<\/p>\n<p>1.- range(Number): this will create a list which starts in 0 and end up one number before the one you wrote, for example:<\/p>\n<p>for i in range(7):<\/p>\n<p>print(i)<\/p>\n<p>&nbsp;<\/p>\n<p>will produce this outcome:<\/p>\n<p>0<\/p>\n<p>1<\/p>\n<p>2<\/p>\n<p>3<\/p>\n<p>4<\/p>\n<p>5<\/p>\n<p>6<\/p>\n<p>2.-range(First number, Last Number) this way you&#8217;re telling python that you don&#8217;t want to start in 0.<\/p>\n<p>Note: Python doesn&#8217;t read the last number, it stops 1 number before, for example:<\/p>\n<p>for i in range (7,10):<\/p>\n<p>print(i)<\/p>\n<p>will produce this outcome:<\/p>\n<p>7<\/p>\n<p>8<\/p>\n<p>9<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Three parameters: range(First Number, Last number, Number that is going to be added)<\/p>\n<p>for example:<\/p>\n<p>for i in range(0, 10, 2): \u00a0 #will produce:<\/p>\n<p>0<\/p>\n<p>2<\/p>\n<p>4<\/p>\n<p>6<\/p>\n<p>8<\/p>\n<p>#it won&#8217;t print 10 because it&#8217;s the last number.<\/p>\n<p>&nbsp;<\/p>\n<p>This page explains a lot of stuffs about range function:\u00a0http:\/\/pythoncentral.io\/pythons-range-function-explained\/<\/p>\n<p>Thanks for watching;)<\/p><br \/>  <a rel=\"nofollow\" href=\"http:\/\/feeds.wordpress.com\/1.0\/gocomments\/sierrablogsite.wordpress.com\/508\/\"><img alt=\"\" border=\"0\" src=\"http:\/\/feeds.wordpress.com\/1.0\/comments\/sierrablogsite.wordpress.com\/508\/\" \/><\/a> <img alt=\"\" border=\"0\" src=\"https:\/\/pixel.wp.com\/b.gif?host=sierrablogsite.wordpress.com&#038;blog=115557456&%23038;post=508&%23038;subd=sierrablogsite&%23038;ref=&%23038;feed=1\" width=\"1\" height=\"1\" \/>","protected":false},"excerpt":{"rendered":"<p>&#8211;Originally published at Sierra&amp;#039;s Blog I&#8217;ve used in others posts the range function but I have never explained it. The range function is a python predeterminated function that creates a list and are principaly used in loops. There are different ways of using the range functions, here are them: 1.- range(Number): this will create a &hellip; <a href=\"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/range\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Range!<\/span><\/a><\/p>\n","protected":false},"author":58,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[26],"class_list":["post-38720","post","type-post","status-publish","format-standard","hentry","category-blogs","category-syndicated","tag-sin-categoria"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/users\/58"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/comments?post=38720"}],"version-history":[{"count":3,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38720\/revisions"}],"predecessor-version":[{"id":38744,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38720\/revisions\/38744"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/media?parent=38720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/categories?post=38720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/tags?post=38720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}