{"id":921,"date":"2017-10-26T09:15:11","date_gmt":"2017-10-26T09:15:11","guid":{"rendered":"http:\/\/learnlearn.uk\/python\/?page_id=921"},"modified":"2022-09-29T08:42:11","modified_gmt":"2022-09-29T08:42:11","slug":"continuous-repetition-loops","status":"publish","type":"page","link":"https:\/\/learnlearn.uk\/python\/continuous-repetition-loops\/","title":{"rendered":"Continuous Repetition with While Loops"},"content":{"rendered":"<div class=\"responsive-tabs\">\n<h2 class=\"tabtitle\">Beginner<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Introduction to While Loops<br \/>\n<iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/wH8_EDlyj1k\" width=\"860\" height=\"500\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/h3>\n<p><a href=\"https:\/\/drive.google.com\/file\/d\/1qNmsBqkN84ck6QIb0GQW1gUbha941Ke9\/preview\">YouTube blocked? Use the Google Drive version<\/a><\/p>\n\n<\/div><h2 class=\"tabtitle\">Advanced <\/h2>\n<div class=\"tabcontent\">\n\n<h3>Advanced While Loops<br \/>\n<iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/VDB327dIM_o\" width=\"860\" height=\"500\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/h3>\n<p><a href=\"https:\/\/drive.google.com\/file\/d\/1uCjONMuM1X0rWh02X_AvihTFYPnIZ641\/preview\">YouTube blocked? Use the Google Drive version<\/a><\/p>\n\n<\/div><h2 class=\"tabtitle\">Cheat Sheet<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Cheat Sheet<\/h3>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #aaaaaa; font-style: italic;\">#Example 1<\/span>\r\nx = <span style=\"color: #009999;\">0<\/span> \r\n<span style=\"color: #0000aa;\">while<\/span> x &lt; <span style=\"color: #009999;\">5<\/span>:\r\n    <span style=\"color: #0000aa;\">print<\/span>(<span style=\"color: #aa5500;\">\"goodbye\"<\/span>)\r\n    x += <span style=\"color: #009999;\">1<\/span>\r\n\r\n<span style=\"color: #aaaaaa; font-style: italic;\">#Example 2<\/span>\r\nname = <span style=\"color: #aa5500;\">\"\"<\/span>\r\n<span style=\"color: #0000aa;\">while<\/span> name.lower() != <span style=\"color: #aa5500;\">\"mr west\"<\/span>:\r\n    name = <span style=\"color: #00aaaa;\">input<\/span>(<span style=\"color: #aa5500;\">\"Who is the best teacher?\"<\/span>)\r\n\r\n<span style=\"color: #aaaaaa; font-style: italic;\">#Example 3<\/span>\r\ntotal = <span style=\"color: #009999;\">0<\/span>\r\n<span style=\"color: #0000aa;\">while<\/span> total &lt;= <span style=\"color: #009999;\">20<\/span>:\r\n    amount = <span style=\"color: #00aaaa;\">int<\/span>(<span style=\"color: #00aaaa;\">input<\/span>(<span style=\"color: #aa5500;\">\"How much to add?\"<\/span>))\r\n    total = total + amount\r\n\r\n<span style=\"color: #aaaaaa; font-style: italic;\">#Example 4      <\/span>\r\ntries_left = <span style=\"color: #009999;\">5<\/span>\r\ncorrect = <span style=\"color: #00aaaa;\">False<\/span>\r\n<span style=\"color: #0000aa;\">while<\/span> tries_left &gt; <span style=\"color: #009999;\">0<\/span> <span style=\"color: #0000aa;\">and<\/span> correct == <span style=\"color: #00aaaa;\">False<\/span>:\r\n    answer = <span style=\"color: #00aaaa;\">input<\/span>(<span style=\"color: #aa5500;\">\"What is 5 times 5?\"<\/span>)\r\n    <span style=\"color: #0000aa;\">if<\/span> answer == <span style=\"color: #aa5500;\">\"25\"<\/span>:\r\n        correct = <span style=\"color: #00aaaa;\">True<\/span>\r\n    <span style=\"color: #0000aa;\">else<\/span>:\r\n        tries_left = tries_left - <span style=\"color: #009999;\">1<\/span>\r\n\r\n<span style=\"color: #0000aa;\">if<\/span> correct:\r\n    <span style=\"color: #0000aa;\">print<\/span>(<span style=\"color: #aa5500;\">\"Well done!\"<\/span>)\r\n<span style=\"color: #0000aa;\">else<\/span>:\r\n    <span style=\"color: #0000aa;\">print<\/span>(<span style=\"color: #aa5500;\">\"Loser!\"<\/span>)\r\n\r\n<span style=\"color: #aaaaaa; font-style: italic;\">#Example 5<\/span>\r\n<span style=\"color: #0000aa;\">while<\/span> <span style=\"color: #00aaaa;\">True<\/span>:\r\n    num = <span style=\"color: #00aaaa;\">input<\/span>(<span style=\"color: #aa5500;\">\"Please enter a number\"<\/span>)\r\n    <span style=\"color: #0000aa;\">if<\/span> <span style=\"color: #0000aa;\">not<\/span> num.isdigit():\r\n        <span style=\"color: #0000aa;\">break<\/span>\r\n\r\n    <span style=\"color: #0000aa;\">elif<\/span> num == <span style=\"color: #009999;\">0<\/span>:\r\n        <span style=\"color: #0000aa;\">continue<\/span>\r\n    <span style=\"color: #0000aa;\">else<\/span>:\r\n        num = <span style=\"color: #00aaaa;\">int<\/span>(num)\r\n        <span style=\"color: #0000aa;\">print<\/span>(<span style=\"color: #aa5500;\">\"The square of the num is:\"<\/span>, num * num)\r\n<\/pre>\n<\/div>\n<p><a href=\"https:\/\/docs.google.com\/document\/d\/1NORnL0oDYMJkfTGuhekBM0hwNSYSYplW6A6duP0ZJgg\/edit?usp=sharing\">Printable Version<\/a><\/p>\n\n<\/div><h2 class=\"tabtitle\">Challenge 13<\/h2>\n<div class=\"tabcontent\">\n\n<p><strong>Challenge 13 &#8211; Login Screen App<\/strong><br \/>\n<iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/touT0q96EFc\" width=\"850\" height=\"550\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><br \/>\n<a href=\"https:\/\/drive.google.com\/file\/d\/1vVUGqiudlqcx_2qFRUtdi66MAxNGnZTW\/preview\">YouTube blocked at school? Use the Google Drive Version\u00a0<\/a><\/p>\n<h3>Login Screen App<\/h3>\n<p><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-886\" src=\"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2017\/09\/bronze-star25.png\" alt=\"\" width=\"25\" height=\"25\" \/>Bronze<\/strong><\/p>\n<ul>\n<li>Create an app that repeatedly asks the user for their password until the correct password is entered.<\/li>\n<\/ul>\n<p><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-887\" src=\"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2017\/09\/silver-star25.png\" alt=\"\" width=\"25\" height=\"25\" \/>Silver<\/strong><\/p>\n<ul>\n<li>Adapt your program so that it asks for both a username and password.<\/li>\n<li>Use os.system(&#8216;clear&#8217;) and time.sleep(1) to improve your app.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-888\" src=\"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2017\/09\/gold-star-25.png\" alt=\"\" width=\"25\" height=\"25\" \/>Gold<\/strong><\/p>\n<ul>\n<li>Limit the number of login attempts using a variable to keep track<\/li>\n<\/ul>\n\n<\/div><h2 class=\"tabtitle\">14<\/h2>\n<div class=\"tabcontent\">\n\n<p><strong>Challenge 14 &#8211;\u00a0<\/strong><strong>Joke App<\/strong><\/p>\n<p>Everybody loves jokes! Create an app that asks users if they want to hear a joke.<br \/>\nIf they answer yes tell them a joke.<br \/>\nKeep repeating the question until they answer yes.<br \/>\n<iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/ElydY_1CjJ0\" width=\"850\" height=\"550\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><br \/>\n<a href=\"https:\/\/drive.google.com\/file\/d\/1sYdXnqT_BsZGj7_GujQqx5QC38icnN2z\/preview\">YouTube blocked at school? Use the Google Drive Version.<\/a><\/p>\n<p><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-886\" src=\"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2017\/09\/bronze-star25.png\" alt=\"\" width=\"25\" height=\"25\" \/>Bronze<\/strong><\/p>\n<ul>\n<li>Ask the yes\/no question, when they answer yes break out of the loop and tell the joke.<\/li>\n<\/ul>\n<p><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-887\" src=\"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2017\/09\/silver-star25.png\" alt=\"\" width=\"25\" height=\"25\" \/>Silver<\/strong><\/p>\n<ul>\n<li>If they answer no, provide suitable feedback and ask the question again.<\/li>\n<li>Use the .lower()\u00a0 method to accept lower or uppercase input.<\/li>\n<\/ul>\n<p><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-888\" src=\"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2017\/09\/gold-star-25.png\" alt=\"\" width=\"25\" height=\"25\" \/>Gold<\/strong><\/p>\n<ul>\n<li>Clear the screen and use time.sleep() where appropriate make your app awesome.<\/li>\n<li>Add some ASCII Art to your joke app.<\/li>\n<\/ul>\n\n<\/div><h2 class=\"tabtitle\">15<\/h2>\n<div class=\"tabcontent\">\n\n<p><strong>Challenge 15 &#8211; Darts 501 to zero Score calculator<\/strong><\/p>\n<p>In darts players start at 501 and work their way down to zero. Create an app that keeps track of the player&#8217;s score and tells them when they have reached zero.<\/p>\n<p><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-886\" src=\"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2017\/09\/bronze-star25.png\" alt=\"\" width=\"25\" height=\"25\" \/>\u00a0Bronze<\/strong><\/p>\n<ul>\n<li>The app should create a score variable, set it to 501 and then keep asking the user to enter their score until they get down to zero.<\/li>\n<\/ul>\n<p><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-887\" src=\"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2017\/09\/silver-star25.png\" alt=\"\" width=\"25\" height=\"25\" \/>\u00a0Silver<\/strong><\/p>\n<ul>\n<li>The program should tell the user how many throws they took.<\/li>\n<li>The program should only accept number inputs and only accept inputs between 0 and 180.<\/li>\n<\/ul>\n<p><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-888\" src=\"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2017\/09\/gold-star-25.png\" alt=\"\" width=\"25\" height=\"25\" \/>\u00a0Gold<\/strong><\/p>\n<ul>\n<li>Create a two player version of the game and let the players know who has won.<\/li>\n<\/ul>\n\n<\/div><h2 class=\"tabtitle\">16<\/h2>\n<div class=\"tabcontent\">\n\n<p><b>Challenge 16 &#8211; Random number guesser game<\/b><\/p>\n<p>You should write a program that asks the user to guess a random number.<\/p>\n<p><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-886\" src=\"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2017\/09\/bronze-star25.png\" alt=\"\" width=\"25\" height=\"25\" \/>Bronze<\/strong><\/p>\n<ul>\n<li>Generate a random number between 0 and 100 and ask the user to guess the number.<\/li>\n<li>Keep asking the user to guess until they correctly guess the hidden number.<\/li>\n<\/ul>\n<p><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-887\" src=\"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2017\/09\/silver-star25.png\" alt=\"\" width=\"25\" height=\"25\" \/>Silver<\/strong><\/p>\n<p>Give the user a hint each time to tell them if they are too high or too low.<\/p>\n<p><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-888\" src=\"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2017\/09\/gold-star-25.png\" alt=\"\" width=\"25\" height=\"25\" \/>Gold<\/strong><\/p>\n<ul>\n<li>Keep track of how many guesses the user made and tell them at the end.<\/li>\n<li>Add the option to select a difficulty level and give them a different number of guesses depending on the option selected.\n<ul>\n<li>Easy &#8211; unlimited tries<\/li>\n<li>Medium &#8211; 10 tries<\/li>\n<li>Hard &#8211; 5 tries.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n<\/div><h2 class=\"tabtitle\">ASCII Art<\/h2>\n<div class=\"tabcontent\">\n\n<p><strong>ASCII Art<\/strong><\/p>\n<p>How to display ASCII Art in your programs<br \/>\n<iframe loading=\"lazy\" src=\"https:\/\/drive.google.com\/file\/d\/1L4zzCY21fvpEVOOLhJkLyvJKRo8dBgoQ\/preview\" width=\"800\" height=\"600\"><\/iframe><\/p>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Introduction to While Loops YouTube blocked? Use the Google Drive version Advanced While Loops YouTube blocked? Use the Google Drive version Cheat Sheet #Example 1 x = 0 while x &lt; 5: print(&#8220;goodbye&#8221;) x += 1 #Example 2 name = &#8220;&#8221; while name.lower() != &#8220;mr west&#8221;: name = input(&#8220;Who is the best teacher?&#8221;) #Example 3&hellip;&nbsp;<a href=\"https:\/\/learnlearn.uk\/python\/continuous-repetition-loops\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Continuous Repetition with While Loops<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"on","neve_meta_content_width":84,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Continuous Repetition with While Loops - Python<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/learnlearn.uk\/python\/continuous-repetition-loops\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Continuous Repetition with While Loops - Python\" \/>\n<meta property=\"og:description\" content=\"Introduction to While Loops YouTube blocked? Use the Google Drive version Advanced While Loops YouTube blocked? Use the Google Drive version Cheat Sheet #Example 1 x = 0 while x &lt; 5: print(&quot;goodbye&quot;) x += 1 #Example 2 name = &quot;&quot; while name.lower() != &quot;mr west&quot;: name = input(&quot;Who is the best teacher?&quot;) #Example 3&hellip;&nbsp;Read More &raquo;Continuous Repetition with While Loops\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learnlearn.uk\/python\/continuous-repetition-loops\/\" \/>\n<meta property=\"og:site_name\" content=\"Python\" \/>\n<meta property=\"article:modified_time\" content=\"2022-09-29T08:42:11+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2017\/09\/bronze-star25.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/learnlearn.uk\/python\/continuous-repetition-loops\/\",\"url\":\"https:\/\/learnlearn.uk\/python\/continuous-repetition-loops\/\",\"name\":\"Continuous Repetition with While Loops - Python\",\"isPartOf\":{\"@id\":\"https:\/\/learnlearn.uk\/python\/#website\"},\"datePublished\":\"2017-10-26T09:15:11+00:00\",\"dateModified\":\"2022-09-29T08:42:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/learnlearn.uk\/python\/continuous-repetition-loops\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learnlearn.uk\/python\/continuous-repetition-loops\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learnlearn.uk\/python\/continuous-repetition-loops\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Python Unit Home\",\"item\":\"https:\/\/learnlearn.uk\/python\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Continuous Repetition with While Loops\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/learnlearn.uk\/python\/#website\",\"url\":\"https:\/\/learnlearn.uk\/python\/\",\"name\":\"Python\",\"description\":\"Programming\",\"publisher\":{\"@id\":\"https:\/\/learnlearn.uk\/python\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/learnlearn.uk\/python\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/learnlearn.uk\/python\/#organization\",\"name\":\"Python\",\"url\":\"https:\/\/learnlearn.uk\/python\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/learnlearn.uk\/python\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2019\/03\/LearnLearnLogowhite.png\",\"contentUrl\":\"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2019\/03\/LearnLearnLogowhite.png\",\"width\":710,\"height\":98,\"caption\":\"Python\"},\"image\":{\"@id\":\"https:\/\/learnlearn.uk\/python\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Continuous Repetition with While Loops - Python","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/learnlearn.uk\/python\/continuous-repetition-loops\/","og_locale":"en_GB","og_type":"article","og_title":"Continuous Repetition with While Loops - Python","og_description":"Introduction to While Loops YouTube blocked? Use the Google Drive version Advanced While Loops YouTube blocked? Use the Google Drive version Cheat Sheet #Example 1 x = 0 while x &lt; 5: print(\"goodbye\") x += 1 #Example 2 name = \"\" while name.lower() != \"mr west\": name = input(\"Who is the best teacher?\") #Example 3&hellip;&nbsp;Read More &raquo;Continuous Repetition with While Loops","og_url":"https:\/\/learnlearn.uk\/python\/continuous-repetition-loops\/","og_site_name":"Python","article_modified_time":"2022-09-29T08:42:11+00:00","og_image":[{"url":"http:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2017\/09\/bronze-star25.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Estimated reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/learnlearn.uk\/python\/continuous-repetition-loops\/","url":"https:\/\/learnlearn.uk\/python\/continuous-repetition-loops\/","name":"Continuous Repetition with While Loops - Python","isPartOf":{"@id":"https:\/\/learnlearn.uk\/python\/#website"},"datePublished":"2017-10-26T09:15:11+00:00","dateModified":"2022-09-29T08:42:11+00:00","breadcrumb":{"@id":"https:\/\/learnlearn.uk\/python\/continuous-repetition-loops\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learnlearn.uk\/python\/continuous-repetition-loops\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/learnlearn.uk\/python\/continuous-repetition-loops\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Python Unit Home","item":"https:\/\/learnlearn.uk\/python\/"},{"@type":"ListItem","position":2,"name":"Continuous Repetition with While Loops"}]},{"@type":"WebSite","@id":"https:\/\/learnlearn.uk\/python\/#website","url":"https:\/\/learnlearn.uk\/python\/","name":"Python","description":"Programming","publisher":{"@id":"https:\/\/learnlearn.uk\/python\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/learnlearn.uk\/python\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/learnlearn.uk\/python\/#organization","name":"Python","url":"https:\/\/learnlearn.uk\/python\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/learnlearn.uk\/python\/#\/schema\/logo\/image\/","url":"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2019\/03\/LearnLearnLogowhite.png","contentUrl":"https:\/\/learnlearn.uk\/python\/wp-content\/uploads\/sites\/4\/2019\/03\/LearnLearnLogowhite.png","width":710,"height":98,"caption":"Python"},"image":{"@id":"https:\/\/learnlearn.uk\/python\/#\/schema\/logo\/image\/"}}]}},"rttpg_featured_image_url":null,"rttpg_author":{"display_name":"learnlearnadmin","author_link":"https:\/\/learnlearn.uk\/python\/author\/learnlearnadmin\/"},"rttpg_comment":0,"rttpg_category":null,"rttpg_excerpt":"Introduction to While Loops YouTube blocked? Use the Google Drive version Advanced While Loops YouTube blocked? Use the Google Drive version Cheat Sheet #Example 1 x = 0 while x &lt; 5: print(\"goodbye\") x += 1 #Example 2 name = \"\" while name.lower() != \"mr west\": name = input(\"Who is the best teacher?\") #Example 3&hellip;&nbsp;Read&hellip;","_links":{"self":[{"href":"https:\/\/learnlearn.uk\/python\/wp-json\/wp\/v2\/pages\/921"}],"collection":[{"href":"https:\/\/learnlearn.uk\/python\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/learnlearn.uk\/python\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/python\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/python\/wp-json\/wp\/v2\/comments?post=921"}],"version-history":[{"count":22,"href":"https:\/\/learnlearn.uk\/python\/wp-json\/wp\/v2\/pages\/921\/revisions"}],"predecessor-version":[{"id":1324,"href":"https:\/\/learnlearn.uk\/python\/wp-json\/wp\/v2\/pages\/921\/revisions\/1324"}],"wp:attachment":[{"href":"https:\/\/learnlearn.uk\/python\/wp-json\/wp\/v2\/media?parent=921"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}