{"id":4390,"date":"2023-11-24T12:02:24","date_gmt":"2023-11-24T12:02:24","guid":{"rendered":"https:\/\/ibex.tech\/python\/?p=4390"},"modified":"2023-11-24T14:07:47","modified_gmt":"2023-11-24T14:07:47","slug":"while-loops","status":"publish","type":"post","link":"https:\/\/ibex.tech\/python\/loops-python\/while-loops","title":{"rendered":"While loops"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">While loop<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>count = 0\nwhile count &lt;= 4:\n    #Next loop\n    print(count)\n    count += 1\n\n\n#A 1 line while loop (the ; character denotes a seperate line of code)\ncount = 0\nwhile count &lt;= 4: print(count); count += 1<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Loop Control<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">Exit loop<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>    break<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Exit and start next iteration<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>    continue<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>While loop Loop Control Exit loop Exit and start next iteration<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[328],"tags":[],"class_list":["post-4390","post","type-post","status-publish","format-standard","hentry","category-loops-python"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4390","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/comments?post=4390"}],"version-history":[{"count":2,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4390\/revisions"}],"predecessor-version":[{"id":4393,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4390\/revisions\/4393"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/media?parent=4390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/categories?post=4390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/tags?post=4390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}