{"id":445,"date":"2025-05-19T19:32:46","date_gmt":"2025-05-19T19:32:46","guid":{"rendered":"https:\/\/buhave.com\/courses\/?p=445"},"modified":"2025-05-20T12:56:49","modified_gmt":"2025-05-20T12:56:49","slug":"control-flow-2","status":"publish","type":"post","link":"https:\/\/buhave.com\/courses\/python\/control-flow-2\/","title":{"rendered":"Control Flow"},"content":{"rendered":"<h2>if, elif, and else statements<\/h2>\n<p>These statements let your program make decisions based on conditions \u2014 they\u2019re the core of control flow in Python.<\/p>\n<h3>Basic Syntax<\/h3>\n<p style=\"text-align: center\"><em>if condition:<\/em><br \/>\n<em># code block if condition is True<\/em><br \/>\n<em>elif another_condition:<\/em><br \/>\n<em># code block if elif is True<\/em><br \/>\n<em>else:<\/em><br \/>\n<em># code block if none are True<\/em><\/p>\n<ul>\n<li>Each condition is checked in order<\/li>\n<li>Indentation (typically 4 spaces) defines code blocks<\/li>\n<li>You can have one if, zero or more elif, and zero or one else<\/li>\n<\/ul>\n<p><strong>Simple Example:<\/strong><\/p>\n<p style=\"text-align: center\"><em>temperature = 25<\/em><\/p>\n<p style=\"text-align: center\"><em>if temperature &gt; 30:<\/em><br \/>\n<em>print(&#8220;It&#8217;s hot outside.&#8221;)<\/em><br \/>\n<em>elif temperature &gt;= 20:<\/em><br \/>\n<em>print(&#8220;It&#8217;s a nice day.&#8221;)<\/em><br \/>\n<em>else:<\/em><br \/>\n<em>print(&#8220;It\u2019s cold outside.&#8221;)<\/em><\/p>\n<p><strong>Output:<\/strong> &#8220;It&#8217;s a nice day.&#8221;<\/p>\n<p><strong>Flow Explanation:<\/strong><\/p>\n<ul>\n<li>If the if condition is True, it runs that block and skips the rest.<\/li>\n<li>If the if is False, Python checks the elif (if any).<\/li>\n<li>If none of the conditions are True, the else block runs.<\/li>\n<\/ul>\n<p><strong>Real-Life Example: Age Check<\/strong><\/p>\n<p style=\"text-align: center\"><em>age = int(input(&#8220;Enter your age: &#8220;))<\/em><\/p>\n<p style=\"text-align: center\"><em>if age &lt; 13:<\/em><br \/>\n<em>print(&#8220;You are a child.&#8221;)<\/em><br \/>\n<em>elif age &lt; 18:<\/em><br \/>\n<em>print(&#8220;You are a teenager.&#8221;)<\/em><br \/>\n<em>else:<\/em><br \/>\n<em>print(&#8220;You are an adult.&#8221;)<\/em><\/p>\n<p><strong>Nesting if Statements<\/strong><\/p>\n<p>You can nest conditions inside others:<\/p>\n<p style=\"text-align: center\"><em>score = 85<\/em><\/p>\n<p style=\"text-align: center\"><em>if score &gt;= 50:<\/em><br \/>\n<em>print(&#8220;You passed!&#8221;)<\/em><br \/>\n<em>if score &gt;= 80:<\/em><br \/>\n<em>print(&#8220;Great job!&#8221;)<\/em><br \/>\n<em>else:<\/em><br \/>\n<em>print(&#8220;You failed.&#8221;)<\/em><\/p>\n<p><strong>Common Mistakes to Avoid<\/strong><\/p>\n<table style=\"width: 100%;border-collapse: collapse;font-family: Arial, sans-serif;margin: 20px 0\">\n<thead>\n<tr>\n<th style=\"padding: 12px;text-align: left;border-bottom: 2px solid #000;font-weight: bold\"><strong>Mistake<\/strong><\/th>\n<th style=\"padding: 12px;text-align: left;border-bottom: 2px solid #000;font-weight: bold\"><strong>Fix<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">Missing colon <code>:<\/code><\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">Add a colon at end of condition<br \/>\n<code>if x == 5<\/code> \u2192 <code>if x == 5:<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">Improper indentation<\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">Use consistent 4-space indentation<br \/>\n<code>print(\"Hello\")<\/code> \u2192 <code>\u00a0\u00a0\u00a0\u00a0print(\"Hello\")<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">Using <code>=<\/code> instead of <code>==<\/code><\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\"><code>=<\/code> is assignment, <code>==<\/code> is comparison<br \/>\n<code>if x = 5:<\/code> \u2192 <code>if x == 5:<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">Forgetting to cast <code>input()<\/code> to <code>int<\/code><\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">Use <code>int(input())<\/code> if comparing numbers<br \/>\n<code>age = input()<\/code> \u2192 <code>age = int(input())<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Quick Quiz<\/strong><\/p>\n<p>What will this print?<\/p>\n<p style=\"text-align: center\"><em>x = 10<\/em><\/p>\n<p style=\"text-align: center\"><em>if x &gt; 20:<\/em><br \/>\n<em>print(&#8220;A&#8221;)<\/em><br \/>\n<em>elif x &gt; 5:<\/em><br \/>\n<em>print(&#8220;B&#8221;)<\/em><br \/>\n<em>else:<\/em><br \/>\n<em>print(&#8220;C&#8221;)<\/em><\/p>\n<p>Answer: &#8220;B&#8221;<\/p>\n<p><strong>Summary Table:<\/strong><\/p>\n<table style=\"width: 100%;border-collapse: collapse;font-family: Arial, sans-serif;margin: 20px 0\">\n<thead>\n<tr>\n<th style=\"padding: 12px;text-align: left;border-bottom: 2px solid #000;font-weight: bold\"><strong>Statement<\/strong><\/th>\n<th style=\"padding: 12px;text-align: left;border-bottom: 2px solid #000;font-weight: bold\"><strong>Purpose<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\"><code>if<\/code><\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">Starts a conditional check<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\"><code>elif<\/code><\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">Checks another condition if the previous <code>if<\/code> or <code>elif<\/code> fails<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\"><code>else<\/code><\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">Runs if no <code>if<\/code> or <code>elif<\/code> conditions are met<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Truthy and falsy values<\/h2>\n<p>In Python, every value has an inherent Boolean value \u2014 either True or False \u2014 even if it&#8217;s not literally the TrueorFalse` Boolean type.<\/p>\n<p>These values are evaluated when used in conditions, such as in if statements.<\/p>\n<h3>What are &#8220;Truthy&#8221; and &#8220;Falsy&#8221;?<\/h3>\n<ul>\n<li>Truthy: A value that evaluates to True when used in a Boolean context.<\/li>\n<li>Falsy: A value that evaluates to False.<\/li>\n<\/ul>\n<p><strong>Example:<\/strong><\/p>\n<p style=\"text-align: center\"><em>if &#8220;hello&#8221;:<\/em><br \/>\n<em>print(&#8220;This is truthy.&#8221;)<\/em><\/p>\n<p><strong>Output:<\/strong> This is truthy.<\/p>\n<ul>\n<li>Because a non-empty string (&#8220;hello&#8221;) is considered truthy.<\/li>\n<\/ul>\n<p><strong>Falsy Values in Python<\/strong><\/p>\n<p>These values are considered False in Boolean contexts:<\/p>\n<table style=\"width: 100%;border-collapse: collapse;font-family: Arial, sans-serif;margin: 20px 0\">\n<thead>\n<tr>\n<th style=\"padding: 12px;text-align: left;border-bottom: 2px solid #000;font-weight: bold\"><strong>Type<\/strong><\/th>\n<th style=\"padding: 12px;text-align: left;border-bottom: 2px solid #000;font-weight: bold\"><strong>Falsy Value<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">Boolean<\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\"><code>False<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">NoneType<\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\"><code>None<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">Numeric<\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\"><code>0<\/code>, <code>0.0<\/code>, <code>0j<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">Sequence\/Collection<\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\"><code>''<\/code> (empty string),<br \/>\n<code>[]<\/code> (empty list),<br \/>\n<code>()<\/code> (empty tuple),<br \/>\n<code>{}<\/code> (empty dict),<br \/>\n<code>set()<\/code> (empty set)<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">Custom object<\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">Any object with <code>__bool__()<\/code> or <code>__len__()<\/code> returning <code>False<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align: center\"><em># All of these evaluate as False<\/em><br \/>\n<em>if not &#8220;&#8221;:<\/em><br \/>\n<em>print(&#8220;Empty string is falsy&#8221;)<\/em><\/p>\n<p style=\"text-align: center\"><em>if not 0:<\/em><br \/>\n<em>print(&#8220;Zero is falsy&#8221;)<\/em><\/p>\n<p style=\"text-align: center\"><em>if not None:<\/em><br \/>\n<em>print(&#8220;None is falsy&#8221;)<\/em><\/p>\n<p style=\"text-align: center\"><em>if not []:<\/em><br \/>\n<em>print(&#8220;Empty list is falsy&#8221;)<\/em><\/p>\n<p><strong>Truthy Values in Python<\/strong><\/p>\n<p>Everything else not listed as falsy is truthy.<\/p>\n<p><strong>Examples:<\/strong><\/p>\n<p style=\"text-align: center\"><em>&#8220;hello&#8221; # non-empty string<\/em><br \/>\n<em>42 # any non-zero number<\/em><br \/>\n<em>[1, 2, 3] # non-empty list<\/em><br \/>\n<em>{&#8220;a&#8221;: 1} # non-empty dictionary<\/em><br \/>\n<em>True # obviously!<\/em><\/p>\n<p><strong>These will all make if statements run:<\/strong><\/p>\n<p style=\"text-align: center\"><em>if [1, 2, 3]:<\/em><br \/>\n<em>print(&#8220;Truthy list!&#8221;)<\/em><\/p>\n<p style=\"text-align: center\"><em>if &#8220;Python&#8221;:<\/em><br \/>\n<em>print(&#8220;Truthy string!&#8221;)<\/em><\/p>\n<p><strong>Boolean Context Examples:<\/strong><\/p>\n<p style=\"text-align: center\"><em>x = []<\/em><\/p>\n<p style=\"text-align: center\"><em>if x:<\/em><br \/>\n<em>print(&#8220;List has items.&#8221;)<\/em><br \/>\n<em>else:<\/em><br \/>\n<em>print(&#8220;List is empty.&#8221;)<\/em><\/p>\n<p><strong>Output:<\/strong> List is empty.<\/p>\n<p><strong>Using bool() to Check Value Truthiness<\/strong><\/p>\n<p>You can test how Python evaluates any value using bool():<\/p>\n<p style=\"text-align: center\"><em>print(bool(0)) # False<\/em><br \/>\n<em>print(bool(&#8220;Hi&#8221;)) # True<\/em><br \/>\n<em>print(bool([])) # False<\/em><br \/>\n<em>print(bool([0])) # True (non-empty list!)<\/em><\/p>\n<p><strong>Summary:<\/strong><\/p>\n<table style=\"width: 100%;border-collapse: collapse;font-family: Arial, sans-serif;margin: 20px 0\">\n<thead>\n<tr>\n<th style=\"padding: 12px;text-align: left;border-bottom: 2px solid #000;font-weight: bold\"><strong>Value Type<\/strong><\/th>\n<th style=\"padding: 12px;text-align: left;border-bottom: 2px solid #000;font-weight: bold\"><strong>Truthy Example<\/strong><\/th>\n<th style=\"padding: 12px;text-align: left;border-bottom: 2px solid #000;font-weight: bold\"><strong>Falsy Example<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">String<\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\"><code>\"Python\"<\/code><\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\"><code>\"\"<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">Number<\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\"><code>42<\/code><\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\"><code>0<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">List<\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\"><code>[1, 2]<\/code><\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\"><code>[]<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">Dictionary<\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\"><code>{\"a\": 1}<\/code><\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\"><code>{}<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">Boolean<\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\"><code>True<\/code><\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\"><code>False<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">NoneType<\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\">\u2014<\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #ddd\"><code>None<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Nested conditionals<\/h2>\n<h3>What Are Nested Conditionals?<\/h3>\n<ul>\n<li>A nested conditional is when you place an if, elif, or else inside another if block.<\/li>\n<li>This lets you check multiple layers of logic, like decision trees.<\/li>\n<\/ul>\n<p><strong>Basic Syntax:<\/strong><\/p>\n<p style=\"text-align: center\"><em>if condition1:<\/em><br \/>\n<em>if condition2:<\/em><br \/>\n<em># Runs if both condition1 AND condition2 are True<\/em><br \/>\n<em>else:<\/em><br \/>\n<em># Runs if condition1 is True but condition2 is False<\/em><br \/>\n<em>else:<\/em><br \/>\n<em># Runs if condition1 is False<\/em><\/p>\n<p><strong>Simple Example:<\/strong><\/p>\n<p style=\"text-align: center\"><em>age = 20<\/em><br \/>\n<em>has_ticket = True<\/em><\/p>\n<p style=\"text-align: center\"><em>if age &gt;= 18:<\/em><br \/>\n<em>if has_ticket:<\/em><br \/>\n<em>print(&#8220;You can enter the event.&#8221;)<\/em><br \/>\n<em>else:<\/em><br \/>\n<em>print(&#8220;You need a ticket to enter.&#8221;)<\/em><br \/>\n<em>else:<\/em><br \/>\n<em>print(&#8220;You must be 18 or older to enter.&#8221;)<\/em><\/p>\n<p><strong>Output:<\/strong><\/p>\n<p>You can enter the event.<\/p>\n<p><strong>Why Use Nested Conditionals?<\/strong><\/p>\n<ul>\n<li>When one condition depends on another<\/li>\n<li>To create multi-level decision structures<\/li>\n<li>When you want to check a second condition only if the first is True<\/li>\n<\/ul>\n<p><strong>Example:<\/strong> Student Grading System<\/p>\n<p style=\"text-align: center\"><em>grade = 85<\/em><\/p>\n<p style=\"text-align: center\"><em>if grade &gt;= 50:<\/em><br \/>\n<em>if grade &gt;= 90:<\/em><br \/>\n<em>print(&#8220;A+&#8221;)<\/em><br \/>\n<em>elif grade &gt;= 80:<\/em><br \/>\n<em>print(&#8220;A&#8221;)<\/em><br \/>\n<em>else:<\/em><br \/>\n<em>print(&#8220;Pass&#8221;)<\/em><br \/>\n<em>else:<\/em><br \/>\n<em>print(&#8220;Fail&#8221;)<\/em><\/p>\n<p><strong>Output:<\/strong><\/p>\n<p>A<\/p>\n<p><strong>Alternative: Combine Conditions with and<\/strong><\/p>\n<p>You can sometimes flatten nested conditionals by using and:<\/p>\n<p style=\"text-align: center\"><em>if age &gt;= 18 and has_ticket:<\/em><br \/>\n<em>print(&#8220;You can enter.&#8221;)<\/em><br \/>\n<em>elif age &gt;= 18:<\/em><br \/>\n<em>print(&#8220;Get a ticket.&#8221;)<\/em><br \/>\n<em>else:<\/em><br \/>\n<em>print(&#8220;You&#8217;re too young.&#8221;)<\/em><\/p>\n<p>Both versions are valid \u2014 use nesting for clarity when conditions are hierarchical.<\/p>\n<p><strong>Common Mistakes to Avoid<\/strong><\/p>\n<table style=\"width: 100%;border-collapse: collapse;font-family: Arial, sans-serif;margin: 20px 0\">\n<thead>\n<tr style=\"background-color: #f8f9fa\">\n<th style=\"padding: 12px;text-align: left;border-bottom: 2px solid #dee2e6;font-weight: 600\"><strong>Mistake<\/strong><\/th>\n<th style=\"padding: 12px;text-align: left;border-bottom: 2px solid #dee2e6;font-weight: 600\"><strong>How to Fix<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding: 12px;border-bottom: 1px solid #dee2e6;vertical-align: top\">Misaligned indentation<\/td>\n<td style=\"padding: 12px;border-bottom: 1px solid #dee2e6;vertical-align: top\">Use consistent <code style=\"background: #f8f9fa;padding: 2px 4px;border-radius: 3px\">4-space<\/code> indentation<\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 12px;border-bottom: 1px solid #dee2e6;vertical-align: top\">Too many nested levels<\/td>\n<td style=\"padding: 12px;border-bottom: 1px solid #dee2e6;vertical-align: top\">Try combining conditions with <code style=\"background: #f8f9fa;padding: 2px 4px;border-radius: 3px\">and<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 12px;border-bottom: 1px solid #dee2e6;vertical-align: top\">Forgetting outer condition<\/td>\n<td style=\"padding: 12px;border-bottom: 1px solid #dee2e6;vertical-align: top\">Make sure inner <code style=\"background: #f8f9fa;padding: 2px 4px;border-radius: 3px\">if<\/code> runs inside the outer<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Summary:<\/strong><\/p>\n<ul>\n<li>Use nested conditionals when one check depends on another.<\/li>\n<li>Can be useful for multi-step logic (e.g. eligibility checks).<\/li>\n<li>Don\u2019t over-nest \u2014 too many levels can make code harder to read.<\/li>\n<\/ul>\n<p><strong>Practice Idea<\/strong><\/p>\n<p><strong>Prompt:<\/strong><\/p>\n<p>Ask the user for:<\/p>\n<ul>\n<li>their age<\/li>\n<li>if they\u2019re a student<\/li>\n<li>Then decide:<\/li>\n<li>If they can get a discount<\/li>\n<li>If they&#8217;re allowed access<\/li>\n<\/ul>\n<p>Want me to write this as an exercise with solution or a quiz-style challenge?<\/p>\n<h2>match (Python 3.10+)<\/h2>\n<h3>What is match?<\/h3>\n<p>The match statement in Python is used for pattern matching. It works like a switch statement in other languages \u2014 but with added power for complex data matching like objects, tuples, and more.<\/p>\n<p>Introduced in Python 3.10, it allows cleaner, more readable conditionals.<\/p>\n<p><strong>Basic Syntax<\/strong><\/p>\n<p style=\"text-align: center\"><em>match variable:<\/em><br \/>\n<em>case pattern1:<\/em><br \/>\n<em># do something<\/em><br \/>\n<em>case pattern2:<\/em><br \/>\n<em># do something else<\/em><br \/>\n<em>case _:<\/em><br \/>\n<em># default case (like else)<\/em><\/p>\n<p><strong>Example 1:<\/strong> Simple Value Matching<\/p>\n<p style=\"text-align: center\"><em>status_code = 404<\/em><\/p>\n<p style=\"text-align: center\"><em>match status_code:<\/em><br \/>\n<em>case 200:<\/em><br \/>\n<em>print(&#8220;OK&#8221;)<\/em><br \/>\n<em>case 404:<\/em><br \/>\n<em>print(&#8220;Not Found&#8221;)<\/em><br \/>\n<em>case 500:<\/em><br \/>\n<em>print(&#8220;Server Error&#8221;)<\/em><br \/>\n<em>case _:<\/em><br \/>\n<em>print(&#8220;Unknown status&#8221;)<\/em><\/p>\n<p><strong>Output:<\/strong><\/p>\n<p style=\"text-align: center\"><em>Not Found<\/em><\/p>\n<p><strong>The Underscore _<\/strong><\/p>\n<p>The _ case is a wildcard \u2014 it matches anything not matched before. Think of it like else.<\/p>\n<p><strong>Example 2:<\/strong> Match with Variables (Capture)<\/p>\n<ul>\n<li>You can also capture values from patterns:<\/li>\n<\/ul>\n<p style=\"text-align: center\"><em>command = (&#8220;move&#8221;, &#8220;left&#8221;)<\/em><\/p>\n<p style=\"text-align: center\"><em>match command:<\/em><br \/>\n<em>case (&#8220;move&#8221;, direction):<\/em><br \/>\n<em>print(f&#8221;Moving {direction}&#8221;)<\/em><br \/>\n<em>case (&#8220;stop&#8221;,):<\/em><br \/>\n<em>print(&#8220;Stopping&#8221;)<\/em><\/p>\n<p><strong>Output:<\/strong><\/p>\n<p>Moving left<\/p>\n<p><strong>Example 3:<\/strong> Match with Multiple Options<\/p>\n<p style=\"text-align: center\"><em>fruit = &#8220;apple&#8221;<\/em><\/p>\n<p style=\"text-align: center\"><em>match fruit:<\/em><br \/>\n<em>case &#8220;apple&#8221; | &#8220;banana&#8221;:<\/em><br \/>\n<em>print(&#8220;It\u2019s a fruit we have.&#8221;)<\/em><br \/>\n<em>case &#8220;kiwi&#8221;:<\/em><br \/>\n<em>print(&#8220;Out of stock.&#8221;)<\/em><br \/>\n<em>case _:<\/em><br \/>\n<em>print(&#8220;Unknown item.&#8221;)<\/em><\/p>\n<p><strong>Output:<\/strong><\/p>\n<p>It\u2019s a fruit we have.<\/p>\n<p><strong>Example 4:<\/strong> Matching with Conditions (if Guards)<\/p>\n<p style=\"text-align: center\"><em>x = 10<\/em><\/p>\n<p style=\"text-align: center\"><em>match x:<\/em><br \/>\n<em>case x if x &gt; 0:<\/em><br \/>\n<em>print(&#8220;Positive number&#8221;)<\/em><br \/>\n<em>case x if x &lt; 0:<\/em><br \/>\n<em>print(&#8220;Negative number&#8221;)<\/em><br \/>\n<em>case _:<\/em><br \/>\n<em>print(&#8220;Zero&#8221;)<\/em><\/p>\n<p><strong>When to Use match<\/strong><\/p>\n<p>Use match when:<\/p>\n<ul>\n<li>You\u2019re matching discrete values (like switch-case)<\/li>\n<li>You need to check data shapes, like tuples or lists<\/li>\n<li>You want cleaner alternatives to long if-elif-else chains<\/li>\n<\/ul>\n<p><strong>Advanced Example: Matching Lists<\/strong><\/p>\n<p style=\"text-align: center\"><em>data = [1, 2, 3]<\/em><\/p>\n<p style=\"text-align: center\"><em>match data:<\/em><br \/>\n<em>case [1, 2, 3]:<\/em><br \/>\n<em>print(&#8220;Exact match&#8221;)<\/em><br \/>\n<em>case [1, *rest]:<\/em><br \/>\n<em>print(f&#8221;Starts with 1, rest is {rest}&#8221;)<\/em><br \/>\n<em>case _:<\/em><br \/>\n<em>print(&#8220;No match&#8221;)<\/em><\/p>\n<p><strong>Summary:<\/strong><\/p>\n<table style=\"width: 100%;border-collapse: collapse;font-family: Arial, sans-serif;margin: 20px 0\">\n<thead>\n<tr style=\"background-color: #f8f9fa\">\n<th style=\"padding: 12px;text-align: left;border-bottom: 2px solid #dee2e6;font-weight: bold\"><strong>Concept<\/strong><\/th>\n<th style=\"padding: 12px;text-align: left;border-bottom: 2px solid #dee2e6;font-weight: bold\"><strong>Keyword or Usage<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #dee2e6\">Start pattern matching<\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #dee2e6\"><code>match<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #dee2e6\">Match specific case<\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #dee2e6\"><code>case value:<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #dee2e6\">Default case<\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #dee2e6\"><code>case _:<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #dee2e6\">OR \/ multiple options<\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #dee2e6\"><code>case \"a\" | \"b\":<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #dee2e6\">Use with tuples\/lists<\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #dee2e6\"><code>case (a, b):<\/code> or <code>case [x, y, z]:<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 10px;border-bottom: 1px solid #dee2e6\">Conditional guard<\/td>\n<td style=\"padding: 10px;border-bottom: 1px solid #dee2e6\"><code>case x if x &gt; 0:<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Bonus Idea<\/strong><\/p>\n<p>Would you like:<\/p>\n<ul>\n<li>Practice problems (e.g. color picker, command handler)?<\/li>\n<li>A side-by-side comparison with if\/elif?<\/li>\n<li>A quiz or mini project using match?<\/li>\n<li>Let me know how you\u2019d like to expand on this!<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>if, elif, and else statements These statements let your program make decisions based on conditions \u2014 they\u2019re the core of control flow in Python. Basic Syntax if condition: # code block if condition is True elif another_condition: # code block if elif is True else:<\/p>\n","protected":false},"author":1,"featured_media":446,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-445","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Control Flow -<\/title>\n<meta name=\"description\" content=\"Control Flow in Python manages the execution path of a program using conditions, loops, and decision-making structures.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/buhave.com\/courses\/python\/control-flow-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Control Flow -\" \/>\n<meta property=\"og:description\" content=\"Control Flow in Python manages the execution path of a program using conditions, loops, and decision-making structures.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/buhave.com\/courses\/python\/control-flow-2\/\" \/>\n<meta property=\"og:site_name\" content=\"BUHAVE\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/BeYouHave\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/naveedsafdarawan\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-19T19:32:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-20T12:56:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/04\/Control-Flow.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Naveed Safdar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Naveed Safdar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/python\\\/control-flow-2\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/python\\\/control-flow-2\\\/\"},\"author\":{\"name\":\"Naveed Safdar\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#\\\/schema\\\/person\\\/04fe0254e118521c9fbb3da39de5acca\"},\"headline\":\"Control Flow\",\"datePublished\":\"2025-05-19T19:32:46+00:00\",\"dateModified\":\"2025-05-20T12:56:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/python\\\/control-flow-2\\\/\"},\"wordCount\":1178,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/python\\\/control-flow-2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/Control-Flow.webp\",\"articleSection\":[\"Python Course\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/buhave.com\\\/courses\\\/python\\\/control-flow-2\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/python\\\/control-flow-2\\\/\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/python\\\/control-flow-2\\\/\",\"name\":\"Control Flow -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/python\\\/control-flow-2\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/python\\\/control-flow-2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/Control-Flow.webp\",\"datePublished\":\"2025-05-19T19:32:46+00:00\",\"dateModified\":\"2025-05-20T12:56:49+00:00\",\"description\":\"Control Flow in Python manages the execution path of a program using conditions, loops, and decision-making structures.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/python\\\/control-flow-2\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/buhave.com\\\/courses\\\/python\\\/control-flow-2\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/python\\\/control-flow-2\\\/#primaryimage\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/Control-Flow.webp\",\"contentUrl\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/Control-Flow.webp\",\"width\":1200,\"height\":628,\"caption\":\"Control Flow\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/python\\\/control-flow-2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Courses\",\"item\":\"https:\\\/\\\/buhave.com\\\/courses\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python Course\",\"item\":\"https:\\\/\\\/buhave.com\\\/courses\\\/learn\\\/python\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Control Flow\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#website\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/\",\"name\":\"BUHAVE\",\"description\":\"Courses - Learn Online for Free\",\"publisher\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/buhave.com\\\/courses\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#organization\",\"name\":\"BUHAVE\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/buhave-course.webp\",\"contentUrl\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/buhave-course.webp\",\"width\":375,\"height\":75,\"caption\":\"BUHAVE\"},\"image\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/BeYouHave\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/buhave\",\"https:\\\/\\\/www.youtube.com\\\/@buhave\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#\\\/schema\\\/person\\\/04fe0254e118521c9fbb3da39de5acca\",\"name\":\"Naveed Safdar\",\"description\":\"I\u2019m Naveed Safdar - SEO Manager with over 10 years of experience in SEO and Digital Marketing. I\u2019ve had the privilege of working with leading national and international companies including Grafdom, PakWheels, Systems Limited, Confiz, Educative, and Dubizzle Labs. My expertise spans technical SEO, content strategy, organic growth, and performance analytics - helping businesses improve visibility, traffic, and ROI.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/naveedsafdar\\\/\",\"https:\\\/\\\/www.facebook.com\\\/naveedsafdarawan\\\/\",\"https:\\\/\\\/www.youtube.com\\\/@naveedsafdar\"],\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/author\\\/naveed-safdar\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Control Flow -","description":"Control Flow in Python manages the execution path of a program using conditions, loops, and decision-making structures.","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:\/\/buhave.com\/courses\/python\/control-flow-2\/","og_locale":"en_US","og_type":"article","og_title":"Control Flow -","og_description":"Control Flow in Python manages the execution path of a program using conditions, loops, and decision-making structures.","og_url":"https:\/\/buhave.com\/courses\/python\/control-flow-2\/","og_site_name":"BUHAVE","article_publisher":"https:\/\/www.facebook.com\/BeYouHave\/","article_author":"https:\/\/www.facebook.com\/naveedsafdarawan\/","article_published_time":"2025-05-19T19:32:46+00:00","article_modified_time":"2025-05-20T12:56:49+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/04\/Control-Flow.webp","type":"image\/webp"}],"author":"Naveed Safdar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Naveed Safdar","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/buhave.com\/courses\/python\/control-flow-2\/#article","isPartOf":{"@id":"https:\/\/buhave.com\/courses\/python\/control-flow-2\/"},"author":{"name":"Naveed Safdar","@id":"https:\/\/buhave.com\/courses\/#\/schema\/person\/04fe0254e118521c9fbb3da39de5acca"},"headline":"Control Flow","datePublished":"2025-05-19T19:32:46+00:00","dateModified":"2025-05-20T12:56:49+00:00","mainEntityOfPage":{"@id":"https:\/\/buhave.com\/courses\/python\/control-flow-2\/"},"wordCount":1178,"commentCount":0,"publisher":{"@id":"https:\/\/buhave.com\/courses\/#organization"},"image":{"@id":"https:\/\/buhave.com\/courses\/python\/control-flow-2\/#primaryimage"},"thumbnailUrl":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/04\/Control-Flow.webp","articleSection":["Python Course"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/buhave.com\/courses\/python\/control-flow-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/buhave.com\/courses\/python\/control-flow-2\/","url":"https:\/\/buhave.com\/courses\/python\/control-flow-2\/","name":"Control Flow -","isPartOf":{"@id":"https:\/\/buhave.com\/courses\/#website"},"primaryImageOfPage":{"@id":"https:\/\/buhave.com\/courses\/python\/control-flow-2\/#primaryimage"},"image":{"@id":"https:\/\/buhave.com\/courses\/python\/control-flow-2\/#primaryimage"},"thumbnailUrl":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/04\/Control-Flow.webp","datePublished":"2025-05-19T19:32:46+00:00","dateModified":"2025-05-20T12:56:49+00:00","description":"Control Flow in Python manages the execution path of a program using conditions, loops, and decision-making structures.","breadcrumb":{"@id":"https:\/\/buhave.com\/courses\/python\/control-flow-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/buhave.com\/courses\/python\/control-flow-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/buhave.com\/courses\/python\/control-flow-2\/#primaryimage","url":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/04\/Control-Flow.webp","contentUrl":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/04\/Control-Flow.webp","width":1200,"height":628,"caption":"Control Flow"},{"@type":"BreadcrumbList","@id":"https:\/\/buhave.com\/courses\/python\/control-flow-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Courses","item":"https:\/\/buhave.com\/courses\/"},{"@type":"ListItem","position":2,"name":"Python Course","item":"https:\/\/buhave.com\/courses\/learn\/python\/"},{"@type":"ListItem","position":3,"name":"Control Flow"}]},{"@type":"WebSite","@id":"https:\/\/buhave.com\/courses\/#website","url":"https:\/\/buhave.com\/courses\/","name":"BUHAVE","description":"Courses - Learn Online for Free","publisher":{"@id":"https:\/\/buhave.com\/courses\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/buhave.com\/courses\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/buhave.com\/courses\/#organization","name":"BUHAVE","url":"https:\/\/buhave.com\/courses\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/buhave.com\/courses\/#\/schema\/logo\/image\/","url":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/03\/buhave-course.webp","contentUrl":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/03\/buhave-course.webp","width":375,"height":75,"caption":"BUHAVE"},"image":{"@id":"https:\/\/buhave.com\/courses\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/BeYouHave\/","https:\/\/www.linkedin.com\/company\/buhave","https:\/\/www.youtube.com\/@buhave"]},{"@type":"Person","@id":"https:\/\/buhave.com\/courses\/#\/schema\/person\/04fe0254e118521c9fbb3da39de5acca","name":"Naveed Safdar","description":"I\u2019m Naveed Safdar - SEO Manager with over 10 years of experience in SEO and Digital Marketing. I\u2019ve had the privilege of working with leading national and international companies including Grafdom, PakWheels, Systems Limited, Confiz, Educative, and Dubizzle Labs. My expertise spans technical SEO, content strategy, organic growth, and performance analytics - helping businesses improve visibility, traffic, and ROI.","sameAs":["https:\/\/www.linkedin.com\/in\/naveedsafdar\/","https:\/\/www.facebook.com\/naveedsafdarawan\/","https:\/\/www.youtube.com\/@naveedsafdar"],"url":"https:\/\/buhave.com\/courses\/author\/naveed-safdar\/"}]}},"_links":{"self":[{"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts\/445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/comments?post=445"}],"version-history":[{"count":1,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts\/445\/revisions"}],"predecessor-version":[{"id":447,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts\/445\/revisions\/447"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/media\/446"}],"wp:attachment":[{"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/media?parent=445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/categories?post=445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/tags?post=445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}