{"id":81,"date":"2024-08-27T09:50:49","date_gmt":"2024-08-27T09:50:49","guid":{"rendered":"https:\/\/techkubo.com\/python\/?p=81"},"modified":"2025-06-20T17:28:51","modified_gmt":"2025-06-20T17:28:51","slug":"python-control-structures","status":"publish","type":"post","link":"https:\/\/techkubo.com\/python\/python-control-structures\/","title":{"rendered":"Python Control Structures"},"content":{"rendered":"\n<p>Control structures allow you to manage the flow of your Python program. They help you make decisions, repeat tasks, and control loop execution. This lesson will cover:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\" role=\"presentation\">Operators: Perform operations on values.<\/p><\/li>\n\n\n\n<li><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\" role=\"presentation\">If, Else, and Elif Statements: Conditional statements for decision-making.<\/p><\/li>\n\n\n\n<li><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\" role=\"presentation\">For-loop and While-loop Statements: Repeating code execution.<\/p><\/li>\n\n\n\n<li>Control Flow Statements: Adjusting loop behavior using break, continue, and pass.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Operators<\/h2>\n\n\n\n<p>Python supports various operators that allow you to manipulate data and evaluate conditions.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Arithmetic Operators:<\/h3>\n\n\n\n<p>These perform basic mathematical operations.<b style=\"font-weight: normal;\"><\/b><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\" role=\"presentation\">+ : Addition<\/p><\/li>\n\n\n\n<li><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\" role=\"presentation\">&#8211; : Subtraction<\/p><\/li>\n\n\n\n<li><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\" role=\"presentation\">* : Multiplication<\/p><\/li>\n\n\n\n<li><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\" role=\"presentation\">\/ : Division<\/p><\/li>\n\n\n\n<li><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\" role=\"presentation\">** : Exponentiation<\/p><\/li>\n\n\n\n<li><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\" role=\"presentation\">% : Modulus (remainder after division)<\/p><\/li>\n\n\n\n<li><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\" role=\"presentation\">\/\/ : Floor division (integer division, without remainder)<\/p><\/li>\n<\/ul>\n\n\n\n<p>Example:<b style=\"font-weight: normal;\"><\/b><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">x = 10\ny = 3\n\nprint(x + y)\u00a0  # 13\nprint(x - y) \u00a0 # 7\nprint(x * y) \u00a0 # 30\nprint(x \/ y) \u00a0 # 3.333...\nprint(x % y)   # 1\nprint(x \/\/ y)\u00a0 # 3<\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\" style=\"margin-top:var(--wp--preset--spacing--40);margin-bottom:var(--wp--preset--spacing--40)\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Comparison Operators:<\/h3>\n\n\n\n<p>These are used to compare two values and return True or False.<b style=\"font-weight: normal;\"><\/b><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\" role=\"presentation\">== : Equal to<\/p><\/li>\n\n\n\n<li><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\" role=\"presentation\">!= : Not equal to<\/p><\/li>\n\n\n\n<li><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\" role=\"presentation\">&gt; : Greater than<\/p><\/li>\n\n\n\n<li><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\" role=\"presentation\">&lt; : Less than<\/p><\/li>\n\n\n\n<li><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\" role=\"presentation\">&gt;= : Greater than or equal to<\/p><\/li>\n\n\n\n<li><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\" role=\"presentation\">&lt;= : Less than or equal to<\/p><\/li>\n<\/ul>\n\n\n\n<p>Example:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">x = 5\ny = 10\n\nprint(x == y) \u00a0 # False\nprint(x != y) \u00a0 # True\nprint(x &lt; y)\u00a0 \u00a0 # True\nprint(x &gt; y)\u00a0 \u00a0 # False<\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\" style=\"margin-top:var(--wp--preset--spacing--40);margin-bottom:var(--wp--preset--spacing--40)\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Logical Operators:<\/h3>\n\n\n\n<p>These are used to combine conditional statements.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\" role=\"presentation\"><strong>and<\/strong> : Returns True if both statements are true.<\/p><\/li>\n\n\n\n<li><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\" role=\"presentation\"><strong>or<\/strong> : Returns True if one of the statements is true.<\/p><\/li>\n\n\n\n<li><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\" role=\"presentation\"><strong>not<\/strong> : Reverses the result.<\/p><\/li>\n<\/ul>\n\n\n\n<p>Example:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">x = 5\ny = 10\n\nprint(x &gt; 3 and y &lt; 15)\u00a0 # True\nprint(x &lt; 3 or y &gt; 15) \u00a0 # False\nprint(not(x == y)) \u00a0 \u00a0 \u00a0 # True<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"color: #000000; font-family: Arial, sans-serif;\">If, Else, and Elif Statements<\/span><\/h2>\n\n\n\n<p>These conditional statements are used to control the flow of execution based on conditions. Python evaluates conditions and executes the corresponding block of code.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">if condition1:\n \u00a0\u00a0\u00a0# Code to execute if condition1 is True\nelif condition2:\n    # Code to execute if condition1 was False and condition2 is True\nelse:\n\u00a0\u00a0\u00a0\u00a0# Code to execute if all conditions are False<\/pre><\/div>\n\n\n\n<p>Example:<b style=\"font-weight: normal;\"><\/b><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">age = 20\n\nif age &lt; 18:\n \u00a0\u00a0\u00a0print(&quot;You are a minor.&quot;)\nelif age == 18:\n \u00a0\u00a0\u00a0print(&quot;You are exactly 18 years old.&quot;)\nelse:\n\u00a0\u00a0\u00a0\u00a0print(&quot;You are an adult.&quot;)<\/pre><\/div>\n\n\n\n<p>Explanation:<\/p>\n\n\n\n<p>The if block executes if the first condition (age &lt; 18) is true. <\/p>\n\n\n\n<p>The elif block executes if the if condition is false but the second condition (age == 18) is true.<\/p>\n\n\n\n<p>The else block executes if none of the conditions are true.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">For-loop and While-loop Statements<\/h2>\n\n\n\n<p>Loops allow you to repeat blocks of code multiple times.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">For-loop<\/h3>\n\n\n\n<p>A for loop is used to iterate over a sequence such as a list, tuple, dictionary, string, or range of numbers. The loop runs once for each item in the sequence.<b style=\"font-weight: normal;\"><br><\/b><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Looping through a List:<\/h4>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">islands = [&quot;Luzon&quot;, &quot;Visayas&quot;, &quot;Mindanao&quot;]\n\nfor island in islands:\n\u00a0\u00a0\u00a0\u00a0print(island)<\/pre><\/div>\n\n\n\n<p>Explanation:<\/p>\n\n\n\n<p>The loop iterates over each item in the islands list and prints it.<b style=\"font-weight: normal;\"><\/b><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\" style=\"margin-top:var(--wp--preset--spacing--30);margin-bottom:var(--wp--preset--spacing--30)\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">Looping through a String:<\/h4>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">word = &quot;Philippines&quot;\n\nfor letter in word:\n \u00a0\u00a0\u00a0print(letter)<\/pre><\/div>\n\n\n\n<p>Explanation:<\/p>\n\n\n\n<p>The loop iterates over each character in the string word and prints it.<b style=\"font-weight: normal;\"><\/b><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\" style=\"margin-top:var(--wp--preset--spacing--30);margin-bottom:var(--wp--preset--spacing--30)\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">Looping through a Dictionary:<\/h4>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">person = {&quot;name&quot;: &quot;Maria&quot;, &quot;age&quot;: 25, &quot;city&quot;: &quot;Cebu&quot;}\n\nfor key, value in person.items():\n\u00a0\u00a0\u00a0\u00a0print(f&quot;{key}: {value}&quot;)<\/pre><\/div>\n\n\n\n<p>Explanation:<\/p>\n\n\n\n<p>The loop iterates through each key-value pair in the person dictionary and prints them.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\" style=\"margin-top:var(--wp--preset--spacing--30);margin-bottom:var(--wp--preset--spacing--30)\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">Using <code>range()<\/code> in For-loops<\/h4>\n\n\n\n<p>The <code>range()<\/code> function generates a sequence of numbers, often used in for-loops. It can take up to three arguments: start, stop, and step.<b style=\"font-weight: normal;\"><\/b><\/p>\n\n\n\n<p>Basic Range Example:<b style=\"font-weight: normal;\"><\/b><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">for i in range(5):\u00a0 # Iterates from 0 to 4\n\u00a0\u00a0\u00a0\u00a0print(i)<\/pre><\/div>\n\n\n\n<p>Explanation:<\/p>\n\n\n\n<p>The loop runs for each number in the range from 0 to 4.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\" style=\"margin-top:var(--wp--preset--spacing--30);margin-bottom:var(--wp--preset--spacing--30)\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">Specifying Start, Stop, and Step:<\/h4>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">for i in range(2, 10, 2):\u00a0 # Iterates from 2 to 8, stepping by 2\n \u00a0\u00a0\u00a0print(i)<\/pre><\/div>\n\n\n\n<p>Explanation:<\/p>\n\n\n\n<p>The loop starts at 2, increments by 2 each time, and stops before reaching 10.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\" style=\"margin-top:var(--wp--preset--spacing--30);margin-bottom:var(--wp--preset--spacing--30)\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">While-loop<\/h3>\n\n\n\n<p>A while loop executes as long as a given condition is true. If the condition never becomes false, the loop will continue indefinitely (becoming an &#8220;infinite loop&#8221;).<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">while condition:\n\u00a0\u00a0\u00a0\u00a0# Code to execute while the condition is True<\/pre><\/div>\n\n\n\n<p>Example:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">count = 1\n\nwhile count &lt;= 5:\n \u00a0\u00a0\u00a0print(&quot;Count:&quot;, count)\n \u00a0\u00a0\u00a0count += 1<\/pre><\/div>\n\n\n\n<p>Explanation:<\/p>\n\n\n\n<p>The loop will keep executing as long as count &lt;= 5 is true. The count variable increments on each iteration.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Control Flow Statements: break, continue, and pass<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">break Statement<\/h3>\n\n\n\n<p>The break statement immediately terminates the loop, regardless of the loop condition.<\/p>\n\n\n\n<p>Syntax:<b style=\"font-weight: normal;\"><\/b><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">for variable in sequence:\n \u00a0\u00a0\u00a0if condition:\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0break\n\u00a0\u00a0\u00a0\u00a0# Other code to execute<\/pre><\/div>\n\n\n\n<p>Example:<b style=\"font-weight: normal;\"><\/b><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">for number in range(10):\n \u00a0\u00a0\u00a0if number == 5:\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0break\n\u00a0\u00a0\u00a0\u00a0print(number)<\/pre><\/div>\n\n\n\n<p>Explanation:<\/p>\n\n\n\n<p>The loop stops when number equals 5, even though the loop was designed to run until 9.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\" style=\"margin-top:var(--wp--preset--spacing--30);margin-bottom:var(--wp--preset--spacing--30)\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">continue Statement<\/h3>\n\n\n\n<p>The continue statement skips the current iteration and moves to the next iteration of the loop.<\/p>\n\n\n\n<p>Syntax:<b style=\"font-weight: normal;\"><\/b><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">for variable in sequence:\n \u00a0\u00a0\u00a0if condition:\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0continue\n\u00a0\u00a0\u00a0\u00a0# Code to execute if condition is not met<\/pre><\/div>\n\n\n\n<p>Example:<b style=\"font-weight: normal;\"><\/b><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">for number in range(5):\n \u00a0\u00a0\u00a0if number == 2:\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0continue\n\u00a0\u00a0\u00a0\u00a0print(number)<\/pre><\/div>\n\n\n\n<p>Explanation:<\/p>\n\n\n\n<p>The number 2 is skipped, and the loop continues with the next iteration.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\" style=\"margin-top:var(--wp--preset--spacing--30);margin-bottom:var(--wp--preset--spacing--30)\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">pass Statement<\/h3>\n\n\n\n<p>The pass statement is a null operation. It does nothing and is used as a placeholder when a statement is syntactically required but you don&#8217;t want to execute any code.<\/p>\n\n\n\n<p>Syntax:<b style=\"font-weight: normal;\"><\/b><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">if condition:\n \u00a0\u00a0\u00a0pass\nelse:\n\u00a0\u00a0\u00a0\u00a0# Code to execute if condition is False<\/pre><\/div>\n\n\n\n<p>Example:<b style=\"font-weight: normal;\"><\/b><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;seti&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">for number in range(3):\n \u00a0\u00a0\u00a0if number == 1:\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0pass\u00a0 # Placeholder\n \u00a0\u00a0\u00a0else:\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0print(number)<\/pre><\/div>\n\n\n\n<p>Explanation:<\/p>\n\n\n\n<p>When number equals 1, the pass statement is executed, which does nothing, and the loop continues.<\/p>\n\n\n\n<p><iframe title=\"Try Python on TechKubo\" src=\"https:\/\/techkubo.com\/python-sim.html\" width=\"100%\" height=\"500\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Control structures allow you to manage the flow of your Python program. They help you make decisions, repeat tasks, and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-81","post","type-post","status-publish","format-standard","hentry","category-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python Control Structures - Python Tutorial<\/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:\/\/techkubo.com\/python\/python-control-structures\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Control Structures - Python Tutorial\" \/>\n<meta property=\"og:description\" content=\"Control structures allow you to manage the flow of your Python program. They help you make decisions, repeat tasks, and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techkubo.com\/python\/python-control-structures\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Tutorial\" \/>\n<meta property=\"article:published_time\" content=\"2024-08-27T09:50:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-20T17:28:51+00:00\" \/>\n<meta name=\"author\" content=\"Manong\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Manong\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/techkubo.com\/python\/python-control-structures\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/techkubo.com\/python\/python-control-structures\/\"},\"author\":{\"name\":\"Manong\",\"@id\":\"https:\/\/techkubo.com\/python\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965\"},\"headline\":\"Python Control Structures\",\"datePublished\":\"2024-08-27T09:50:49+00:00\",\"dateModified\":\"2025-06-20T17:28:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/techkubo.com\/python\/python-control-structures\/\"},\"wordCount\":574,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/techkubo.com\/python\/#organization\"},\"articleSection\":[\"python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/techkubo.com\/python\/python-control-structures\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/techkubo.com\/python\/python-control-structures\/\",\"url\":\"https:\/\/techkubo.com\/python\/python-control-structures\/\",\"name\":\"Python Control Structures - Python Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/techkubo.com\/python\/#website\"},\"datePublished\":\"2024-08-27T09:50:49+00:00\",\"dateModified\":\"2025-06-20T17:28:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/techkubo.com\/python\/python-control-structures\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/techkubo.com\/python\/python-control-structures\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/techkubo.com\/python\/python-control-structures\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/techkubo.com\/python\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python Control Structures\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/techkubo.com\/python\/#website\",\"url\":\"https:\/\/techkubo.com\/python\/\",\"name\":\"Python Tutorial\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/techkubo.com\/python\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/techkubo.com\/python\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/techkubo.com\/python\/#organization\",\"name\":\"Python Tutorial\",\"url\":\"https:\/\/techkubo.com\/python\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/techkubo.com\/python\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/techkubo.com\/python\/wp-content\/uploads\/sites\/2\/2025\/01\/cropped-Techkubo-logo-1.png\",\"contentUrl\":\"https:\/\/techkubo.com\/python\/wp-content\/uploads\/sites\/2\/2025\/01\/cropped-Techkubo-logo-1.png\",\"width\":1620,\"height\":1156,\"caption\":\"Python Tutorial\"},\"image\":{\"@id\":\"https:\/\/techkubo.com\/python\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/techkubo.com\/python\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965\",\"name\":\"Manong\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/techkubo.com\/python\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/21a7455736c21887b8fefe0935012d65?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/21a7455736c21887b8fefe0935012d65?s=96&d=mm&r=g\",\"caption\":\"Manong\"},\"sameAs\":[\"https:\/\/techkubo.com\"],\"url\":\"https:\/\/techkubo.com\/python\/author\/manong\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Control Structures - Python Tutorial","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:\/\/techkubo.com\/python\/python-control-structures\/","og_locale":"en_US","og_type":"article","og_title":"Python Control Structures - Python Tutorial","og_description":"Control structures allow you to manage the flow of your Python program. They help you make decisions, repeat tasks, and [&hellip;]","og_url":"https:\/\/techkubo.com\/python\/python-control-structures\/","og_site_name":"Python Tutorial","article_published_time":"2024-08-27T09:50:49+00:00","article_modified_time":"2025-06-20T17:28:51+00:00","author":"Manong","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Manong","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techkubo.com\/python\/python-control-structures\/#article","isPartOf":{"@id":"https:\/\/techkubo.com\/python\/python-control-structures\/"},"author":{"name":"Manong","@id":"https:\/\/techkubo.com\/python\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965"},"headline":"Python Control Structures","datePublished":"2024-08-27T09:50:49+00:00","dateModified":"2025-06-20T17:28:51+00:00","mainEntityOfPage":{"@id":"https:\/\/techkubo.com\/python\/python-control-structures\/"},"wordCount":574,"commentCount":0,"publisher":{"@id":"https:\/\/techkubo.com\/python\/#organization"},"articleSection":["python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techkubo.com\/python\/python-control-structures\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techkubo.com\/python\/python-control-structures\/","url":"https:\/\/techkubo.com\/python\/python-control-structures\/","name":"Python Control Structures - Python Tutorial","isPartOf":{"@id":"https:\/\/techkubo.com\/python\/#website"},"datePublished":"2024-08-27T09:50:49+00:00","dateModified":"2025-06-20T17:28:51+00:00","breadcrumb":{"@id":"https:\/\/techkubo.com\/python\/python-control-structures\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techkubo.com\/python\/python-control-structures\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/techkubo.com\/python\/python-control-structures\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techkubo.com\/python\/"},{"@type":"ListItem","position":2,"name":"Python Control Structures"}]},{"@type":"WebSite","@id":"https:\/\/techkubo.com\/python\/#website","url":"https:\/\/techkubo.com\/python\/","name":"Python Tutorial","description":"","publisher":{"@id":"https:\/\/techkubo.com\/python\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techkubo.com\/python\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techkubo.com\/python\/#organization","name":"Python Tutorial","url":"https:\/\/techkubo.com\/python\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techkubo.com\/python\/#\/schema\/logo\/image\/","url":"https:\/\/techkubo.com\/python\/wp-content\/uploads\/sites\/2\/2025\/01\/cropped-Techkubo-logo-1.png","contentUrl":"https:\/\/techkubo.com\/python\/wp-content\/uploads\/sites\/2\/2025\/01\/cropped-Techkubo-logo-1.png","width":1620,"height":1156,"caption":"Python Tutorial"},"image":{"@id":"https:\/\/techkubo.com\/python\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/techkubo.com\/python\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965","name":"Manong","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techkubo.com\/python\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/21a7455736c21887b8fefe0935012d65?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/21a7455736c21887b8fefe0935012d65?s=96&d=mm&r=g","caption":"Manong"},"sameAs":["https:\/\/techkubo.com"],"url":"https:\/\/techkubo.com\/python\/author\/manong\/"}]}},"_links":{"self":[{"href":"https:\/\/techkubo.com\/python\/wp-json\/wp\/v2\/posts\/81"}],"collection":[{"href":"https:\/\/techkubo.com\/python\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techkubo.com\/python\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techkubo.com\/python\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techkubo.com\/python\/wp-json\/wp\/v2\/comments?post=81"}],"version-history":[{"count":20,"href":"https:\/\/techkubo.com\/python\/wp-json\/wp\/v2\/posts\/81\/revisions"}],"predecessor-version":[{"id":695,"href":"https:\/\/techkubo.com\/python\/wp-json\/wp\/v2\/posts\/81\/revisions\/695"}],"wp:attachment":[{"href":"https:\/\/techkubo.com\/python\/wp-json\/wp\/v2\/media?parent=81"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techkubo.com\/python\/wp-json\/wp\/v2\/categories?post=81"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techkubo.com\/python\/wp-json\/wp\/v2\/tags?post=81"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}