{"id":22990,"date":"2021-12-09T13:07:53","date_gmt":"2021-12-09T07:37:53","guid":{"rendered":"https:\/\/tutorial.eyehunts.com\/?p=22990"},"modified":"2023-07-24T17:23:20","modified_gmt":"2023-07-24T11:53:20","slug":"python-exit-while-loop-with-user-input-example-code","status":"publish","type":"post","link":"https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/","title":{"rendered":"Python exit while loop with user input | Example code"},"content":{"rendered":"\n<p>The while statement has a <a href=\"https:\/\/tutorial.eyehunts.com\/python\/python-conditional-expression-basics\/\">conditional expression<\/a>, and the user enters the String. Just need to use user input in the while statement conditional and evaluate it. If false then Python exits while loop with user input.<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Example exit while loop with user input in Python<\/strong><\/h2>\n\n\n\n<p>Simple example code.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>flag = \"1\"\n\nwhile flag != \"0\":\n\n    print(\"Not broken\")\n    flag = input(\"to break loop enter '0': \")\n<\/code><\/pre>\n\n\n\n<p><strong>Output<\/strong>:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"412\" height=\"190\" src=\"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/12\/Python-exit-while-loop-with-user-input.jpg?resize=412%2C190&#038;ssl=1\" alt=\"Python exit while loop with user input\" class=\"wp-image-23082\"\/><\/figure><\/div>\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Another example<\/strong><\/p>\n\n\n\n<p>Add the movie entered to a list. Continue asking for a movie until the user enters \u20180\u2019. After all, movies have been input, output the list of movies one movie per line.<\/p>\n\n\n\n<p>Use the break keyword to interrupt either a <strong>while <\/strong>or a <a href=\"https:\/\/tutorial.eyehunts.com\/python\/python-exit-for-loop-example-code\/\">for-loop<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def addMovie():\n    movies = &#91;]\n    while True:\n        movie = input(\"Enter the name of a movie: \")\n        if movie == \"0\":\n            break\n        else:\n            movies.append(movie)\n\n    print(\"That's your list\")\n    print(movies)\n\n\naddMovie()<\/code><\/pre>\n\n\n\n<p><strong>Output<\/strong>:<\/p>\n\n\n\n<p>Enter the name of a movie: AAA<br>Enter the name of a movie: BBB<br>Enter the name of a movie: 0<br>That&#8217;s your list<br>[&#8216;AAA&#8217;, &#8216;BBB&#8217;]<\/p>\n\n\n\n<p><strong>Source<\/strong>: stackoverflow.com<\/p>\n\n\n\n<p>To exit a while loop in Python based on user input, you can use a condition that checks for the desired input from the user. Here&#8217;s an example of how you can achieve this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>while True:\r\n    user_input = input(\"Enter 'exit' to quit the loop: \")\r\n\r\n    if user_input.lower() == 'exit':\r\n        break  # Exit the while loop\r\n\r\n    # Do something with the user input or perform other tasks within the loop\r\n    print(\"You entered:\", user_input)\r\n\r\n# Code continues here after the while loop is exited\r\nprint(\"Loop has been exited.\")\r<\/code><\/pre>\n\n\n\n<p>In this example, the <code>while True:<\/code> creates an infinite loop, meaning the loop will keep executing until the <code>break<\/code> statement is encountered. The <code>input()<\/code> function takes user input as a string, and the <code>lower()<\/code> method is used to convert the input to lowercase, so the loop will exit regardless of whether the user entered &#8216;exit&#8217;, &#8216;EXIT&#8217;, &#8216;ExIt&#8217;, etc.<\/p>\n\n\n\n<p>When the user enters &#8216;exit&#8217;, the <code>break<\/code> statement will be executed, and the loop will be exited, allowing the program to continue with the statement after the while loop.<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Comment if you have any doubts or suggestions on this Python input function.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>Note:<\/strong> IDE:&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.jetbrains.com\/pycharm\/\" target=\"_blank\">PyCharm<\/a>&nbsp;2021.3.3 (Community Edition)<\/p><p>Windows 10<\/p><p><strong>Python 3.10.1<\/strong><\/p><p>All<strong>&nbsp;Python Examples&nbsp;are in&nbsp;Python&nbsp;3<\/strong>, so Maybe its different from python 2 or upgraded versions.<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>The while statement has a conditional expression, and the user enters the String. Just need to use user input in the while statement conditional and evaluate it. If false then Python exits while loop with user input. Example exit while loop with user input in Python Simple example code. Output: Another example Add the movie&hellip;&nbsp;<a href=\"https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Python exit while loop with user input | Example code<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[30],"tags":[266,263,36,170],"post_series":[],"class_list":["post-22990","post","type-post","status-publish","format-standard","hentry","category-python","tag-python-exit","tag-python-input","tag-python-loops","tag-python-while"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.1.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python exit while loop with user input | Example code<\/title>\n<meta name=\"description\" content=\"Just need to use user input in the while statement conditional and evaluate it. If false then Python exits while loop with user input.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python exit while loop with user input | Example code\" \/>\n<meta property=\"og:description\" content=\"Just need to use user input in the while statement conditional and evaluate it. If false then Python exits while loop with user input.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-09T07:37:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-24T11:53:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/12\/Python-exit-while-loop-with-user-input.jpg\" \/>\n<meta name=\"author\" content=\"Rohit\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rohit\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/\",\"url\":\"https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/\",\"name\":\"Python exit while loop with user input | Example code\",\"isPartOf\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/12\/Python-exit-while-loop-with-user-input.jpg\",\"datePublished\":\"2021-12-09T07:37:53+00:00\",\"dateModified\":\"2023-07-24T11:53:20+00:00\",\"author\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/69ca2cb8c13fdce0ee5b39d6175119b1\"},\"description\":\"Just need to use user input in the while statement conditional and evaluate it. If false then Python exits while loop with user input.\",\"breadcrumb\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/12\/Python-exit-while-loop-with-user-input.jpg?fit=412%2C190&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/12\/Python-exit-while-loop-with-user-input.jpg?fit=412%2C190&ssl=1\",\"width\":412,\"height\":190},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/tutorial.eyehunts.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python exit while loop with user input | Example code\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/#website\",\"url\":\"https:\/\/tutorial.eyehunts.com\/\",\"name\":\"Tutorial\",\"description\":\"By EyeHunts\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/tutorial.eyehunts.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/69ca2cb8c13fdce0ee5b39d6175119b1\",\"name\":\"Rohit\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/tutorial.eyehunts.com\/wp-content\/litespeed\/avatar\/2b27529b86d6dfb5336897e07c93a827.jpg?ver=1777979855\",\"contentUrl\":\"https:\/\/tutorial.eyehunts.com\/wp-content\/litespeed\/avatar\/2b27529b86d6dfb5336897e07c93a827.jpg?ver=1777979855\",\"caption\":\"Rohit\"},\"description\":\"Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology &amp; like learning technical.\",\"url\":\"https:\/\/tutorial.eyehunts.com\/author\/rohit\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python exit while loop with user input | Example code","description":"Just need to use user input in the while statement conditional and evaluate it. If false then Python exits while loop with user input.","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:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/","og_locale":"en_US","og_type":"article","og_title":"Python exit while loop with user input | Example code","og_description":"Just need to use user input in the while statement conditional and evaluate it. If false then Python exits while loop with user input.","og_url":"https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/","og_site_name":"Tutorial","article_published_time":"2021-12-09T07:37:53+00:00","article_modified_time":"2023-07-24T11:53:20+00:00","og_image":[{"url":"https:\/\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/12\/Python-exit-while-loop-with-user-input.jpg","type":"","width":"","height":""}],"author":"Rohit","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Rohit","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/","url":"https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/","name":"Python exit while loop with user input | Example code","isPartOf":{"@id":"https:\/\/tutorial.eyehunts.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/#primaryimage"},"image":{"@id":"https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/#primaryimage"},"thumbnailUrl":"https:\/\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/12\/Python-exit-while-loop-with-user-input.jpg","datePublished":"2021-12-09T07:37:53+00:00","dateModified":"2023-07-24T11:53:20+00:00","author":{"@id":"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/69ca2cb8c13fdce0ee5b39d6175119b1"},"description":"Just need to use user input in the while statement conditional and evaluate it. If false then Python exits while loop with user input.","breadcrumb":{"@id":"https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/#primaryimage","url":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/12\/Python-exit-while-loop-with-user-input.jpg?fit=412%2C190&ssl=1","contentUrl":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/12\/Python-exit-while-loop-with-user-input.jpg?fit=412%2C190&ssl=1","width":412,"height":190},{"@type":"BreadcrumbList","@id":"https:\/\/tutorial.eyehunts.com\/python\/python-exit-while-loop-with-user-input-example-code\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/tutorial.eyehunts.com\/"},{"@type":"ListItem","position":2,"name":"Python exit while loop with user input | Example code"}]},{"@type":"WebSite","@id":"https:\/\/tutorial.eyehunts.com\/#website","url":"https:\/\/tutorial.eyehunts.com\/","name":"Tutorial","description":"By EyeHunts","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/tutorial.eyehunts.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/69ca2cb8c13fdce0ee5b39d6175119b1","name":"Rohit","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/image\/","url":"https:\/\/tutorial.eyehunts.com\/wp-content\/litespeed\/avatar\/2b27529b86d6dfb5336897e07c93a827.jpg?ver=1777979855","contentUrl":"https:\/\/tutorial.eyehunts.com\/wp-content\/litespeed\/avatar\/2b27529b86d6dfb5336897e07c93a827.jpg?ver=1777979855","caption":"Rohit"},"description":"Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology &amp; like learning technical.","url":"https:\/\/tutorial.eyehunts.com\/author\/rohit\/"}]}},"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":22996,"url":"https:\/\/tutorial.eyehunts.com\/python\/how-to-keep-asking-for-user-input-python-example-code\/","url_meta":{"origin":22990,"position":0},"title":"How to keep asking for user input Python | Example code","author":"Rohit","date":"December 9, 2021","format":false,"excerpt":"There are two ways to keep asking for user input in Python. First using while true with if statement and break statement. while True: # Loop continuously inp = input() # Get the input if inp == \"\": # If it is a blank line... break # ...break the loop\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"How to keep asking for user input Python","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/12\/How-to-keep-asking-for-user-input-Python.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":22975,"url":"https:\/\/tutorial.eyehunts.com\/python\/python-while-loop-user-input-example-code\/","url_meta":{"origin":22990,"position":1},"title":"Python while loop user input | Example code","author":"Rohit","date":"December 7, 2021","format":false,"excerpt":"You can create a while with user input-based value evaluation with conditions. Just need to take input from the user and evaluate those values in the while loop expression condition. Example while loop user input in Python A simple example code takes input from the user and adds values into\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"Python while loop user input","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/12\/Python-while-loop-user-input.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":22992,"url":"https:\/\/tutorial.eyehunts.com\/python\/how-to-take-multiple-inputs-in-python-using-while-loop-example-code\/","url_meta":{"origin":22990,"position":2},"title":"How to take multiple inputs in Python using while loop | Example code","author":"Rohit","date":"December 11, 2021","format":false,"excerpt":"Use While True to take multiple inputs in Python using a while loop. Don't forget to break the loop based on input. Here's a step-by-step guide on how to achieve this: Initialize an empty list to store the inputs. Set up a while loop with a condition that allows the\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/12\/How-to-take-multiple-inputs-in-Python-using-while-loop.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":22998,"url":"https:\/\/tutorial.eyehunts.com\/python\/python-while-input-is-not-empty-example-code\/","url_meta":{"origin":22990,"position":3},"title":"Python while input is not empty | Example code","author":"Rohit","date":"December 8, 2021","format":false,"excerpt":"You have to use a break statement if the user enters some value. Where the while loop will run and prompt the input message until the user gives some value. The syntax for while input is not empty in Python. while True: s = input() if not s: break somelist.append(s)\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"Python while input is not empty","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/12\/Python-while-input-is-not-empty.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":22994,"url":"https:\/\/tutorial.eyehunts.com\/python\/python-while-loop-input-validation-example-code\/","url_meta":{"origin":22990,"position":4},"title":"Python while loop input validation | Example code","author":"Rohit","date":"December 13, 2021","format":false,"excerpt":"Data validation is important when the user input it. It makes sure it is valid before it is used in a computation. You can do Input Validation with While Loops in Python. Example while loop input validation in Python Simple example code While loop with List calculates BMI in Python.\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"Python while loop input validation","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/12\/Python-while-loop-input-validation.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":23087,"url":"https:\/\/tutorial.eyehunts.com\/python\/while-loop-yes-or-no-python-example-code\/","url_meta":{"origin":22990,"position":5},"title":"While loop Yes or No Python | Example code","author":"Rohit","date":"December 9, 2021","format":false,"excerpt":"Use while true with if statement and break statement to create a While loop yes or no in Python. Simple if while condition equal to \"N\" then wait for the user input of Y before exiting. The basic syntax of a while loop in Python is as follows: while condition:\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"While loop yes or no Python","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/12\/While-loop-yes-or-no-Python.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/posts\/22990","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/comments?post=22990"}],"version-history":[{"count":1,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/posts\/22990\/revisions"}],"predecessor-version":[{"id":41245,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/posts\/22990\/revisions\/41245"}],"wp:attachment":[{"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/media?parent=22990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/categories?post=22990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/tags?post=22990"},{"taxonomy":"post_series","embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/post_series?post=22990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}