{"id":38230,"date":"2016-10-24T02:03:31","date_gmt":"2016-10-24T07:03:31","guid":{"rendered":"http:\/\/chebasquared.wordpress.com\/?p=242"},"modified":"2016-10-24T02:03:31","modified_gmt":"2016-10-24T07:03:31","slug":"while-waiting-for-a-new-entry","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/while-waiting-for-a-new-entry\/","title":{"rendered":"WHILE waiting FOR a new entry"},"content":{"rendered":"<p class=\"syndicated-attribution\"><em> --Originally published at <a href=\"https:\/\/chebasquared.wordpress.com\/2016\/10\/24\/while-waiting-for-a-new-entry\/\"><a href=\"https:\/\/chebasquared.wordpress.com\">Monty Python and the Blogging Tale<\/a><\/a><\/em><br \/><\/p>\n<p>So, this is really easy to understand; when to use a WHILE loop and when to use a FOR loop. So it basically breaks down to what you know and what you do not know; if you do not know the extension or range of your data structure, then use a while; like for example, when you ask the user for an integer, you really do not know if the user is going to give you a number, so you create a while loop that repeats itself until the users gives you an integer:<img class=\"alignnone size-full wp-image-251\" src=\"https:\/\/chebasquared.files.wordpress.com\/2016\/10\/while.png?w=665\" alt=\"while\" srcset=\"https:\/\/chebasquared.files.wordpress.com\/2016\/10\/while.png 459w, https:\/\/chebasquared.files.wordpress.com\/2016\/10\/while.png?w=150 150w, https:\/\/chebasquared.files.wordpress.com\/2016\/10\/while.png?w=300 300w\" sizes=\"(max-width: 459px) 100vw, 459px\"   \/><\/p>\n<p>But if you actually know the extension of your data structure (it could be a list, or a tuple), use a for:<\/p>\n<p><img class=\"alignnone size-full wp-image-254\" src=\"https:\/\/chebasquared.files.wordpress.com\/2016\/10\/for.png?w=665\" alt=\"for\" srcset=\"https:\/\/chebasquared.files.wordpress.com\/2016\/10\/for.png 454w, https:\/\/chebasquared.files.wordpress.com\/2016\/10\/for.png?w=150 150w, https:\/\/chebasquared.files.wordpress.com\/2016\/10\/for.png?w=300 300w\" sizes=\"(max-width: 454px) 100vw, 454px\"   \/><\/p>\n<p>As simple as that.<\/p><br \/>  <a rel=\"nofollow\" href=\"http:\/\/feeds.wordpress.com\/1.0\/gocomments\/chebasquared.wordpress.com\/242\/\"><img alt=\"\" border=\"0\" src=\"http:\/\/feeds.wordpress.com\/1.0\/comments\/chebasquared.wordpress.com\/242\/\" \/><\/a> <img alt=\"\" border=\"0\" src=\"https:\/\/pixel.wp.com\/b.gif?host=chebasquared.wordpress.com&#038;blog=115349857&%23038;post=242&%23038;subd=chebasquared&%23038;ref=&%23038;feed=1\" width=\"1\" height=\"1\" \/>","protected":false},"excerpt":{"rendered":"<p>&#8211;Originally published at Monty Python and the Blogging Tale So, this is really easy to understand; when to use a WHILE loop and when to use a FOR loop. So it basically breaks down to what you know and what you do not know; if you do not know the extension or range of your &hellip; <a href=\"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/while-waiting-for-a-new-entry\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">WHILE waiting FOR a new entry<\/span><\/a><\/p>\n","protected":false},"author":43,"featured_media":251,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[79,175,80,24,33,121],"class_list":["post-38230","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogs","category-syndicated","tag-chebacheba","tag-for","tag-kencourses","tag-python","tag-tc101","tag-while"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38230","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\/43"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/comments?post=38230"}],"version-history":[{"count":12,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38230\/revisions"}],"predecessor-version":[{"id":42998,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38230\/revisions\/42998"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/media?parent=38230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/categories?post=38230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/tags?post=38230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}