

{"id":26459,"date":"2018-08-28T05:45:13","date_gmt":"2018-08-28T00:15:13","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=26459"},"modified":"2026-04-28T11:13:51","modified_gmt":"2026-04-28T05:43:51","slug":"python-ternary-operator","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/python-ternary-operator\/","title":{"rendered":"Python Ternary Operator &#8211; 5 Ways To Implement Ternary Operators"},"content":{"rendered":"<p><span style=\"font-weight: 400\">Today, we will see the Python Ternary Operator. Moreover, we will discuss the example and syntax of the Ternary<a href=\"https:\/\/data-flair.training\/blogs\/python-operators\/\" target=\"_blank\" rel=\"noopener\"> <strong>Operator in Python<\/strong><\/a>. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Also, we will learn about and nested Python Ternary Operators. At last, we will discuss ways for implementing Ternary operators in Python.<\/span><\/p>\n<p>So, let&#8217;s start with the Python Ternary Operator.<\/p>\n<h3>What is a Python Ternary Operator?<\/h3>\n<p><span style=\"font-weight: 400\">Ternary operators in Python are conditional expressions. These are operators that test a condition and, based on that, evaluate a value.<\/span><\/p>\n<p><strong>Benefits of ternary operators in Python:<\/strong><\/p>\n<ul>\n<li><strong>Concise:<\/strong> It makes long if- else code into small lines which makes the code smaller and easy to understand.<\/li>\n<li><strong>Efficient:<\/strong> It checks the part which is only important , avoiding wastage of time.<\/li>\n<li><strong>Works in Functional Code:<\/strong> It can be used in lambda functions, list comprehensions, and dictionaries where a normal if-else cannot be used.<\/li>\n<\/ul>\n<p>Use the ternary operator only when the outcome is short and clear. If either branch runs many actions, move back to a regular if-else for clarity. Clean formatting keeps code beginner-friendly and maintains Python\u2019s guiding rule: readability counts.<\/p>\n<h4>1. Python if-else code<\/h4>\n<p><span style=\"font-weight: 400\">Let\u2019s write code to compare two integers.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; a,b=2,3\r\n&gt;&gt;&gt; if a&gt;b:\r\n        print(\"a\")\r\nelse:\r\n        print(\"b\")<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">b<\/div>\n<h4>2. Equivalent code with the Ternary operator in python<\/h4>\n<p><span style=\"font-weight: 400\">So let\u2019s try doing the same with ternary operators:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; a,b=2,3\r\n&gt;&gt;&gt; print(\"a\" if a&gt;b else \"b\")<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">b<\/div>\n<p><span style=\"font-weight: 400\">Voila! Done in one line. Python first evaluates the condition. If true, it evaluates the first expression; otherwise, it evaluates the second. <\/span><\/p>\n<p><span style=\"font-weight: 400\">There is <\/span><i><span style=\"font-weight: 400\">a lazy evaluation<\/span><\/i><span style=\"font-weight: 400\">. It also evaluates the conditions left to right.<\/span><\/p>\n<h3>The syntax for Python Ternary Operator<\/h3>\n<p><span style=\"font-weight: 400\">Now, let\u2019s learn a little about the syntax for Python Ternary Operator.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">[on_true] if [expression] else [on_false]<\/pre>\n<p><span style=\"font-weight: 400\">In C++, it looks like this:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">max=(a&gt;b)?a:b<\/pre>\n<p><span style=\"font-weight: 400\">But this isn\u2019t quite Pythonic, so Guido, Python\u2019s BDFL (a status from which he has resigned permanently), rejected it. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Another reason for the veto is that we already have many uses for the colon(:).<\/span><\/p>\n<p><span style=\"font-weight: 400\">One more example of Python ternary Operators:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; from random import random\r\n&gt;&gt;&gt; a,b=random(),random()\r\n&gt;&gt;&gt; res=\"a\" if a&gt;b else \"b\"\r\n&gt;&gt;&gt; res<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">&#8216;b&#8217;<\/div>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; a,b<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">(0.009415785735741311, 0.9675879478005226)<\/div>\n<h3>Ways to Implement the Ternary Operator in Python<\/h3>\n<p>Below, we are discussing different ways of implementing the Python Ternary Operator:<\/p>\n<div id=\"attachment_26502\" style=\"width: 1210px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Python-Ways-to-Implement-Ternary-Operator-01-1.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-26502\" class=\"wp-image-26502 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Python-Ways-to-Implement-Ternary-Operator-01-1.jpg\" alt=\"Python Ternary Operator\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Python-Ways-to-Implement-Ternary-Operator-01-1.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Python-Ways-to-Implement-Ternary-Operator-01-1-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Python-Ways-to-Implement-Ternary-Operator-01-1-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Python-Ways-to-Implement-Ternary-Operator-01-1-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Python-Ways-to-Implement-Ternary-Operator-01-1-1024x536.jpg 1024w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><p id=\"caption-attachment-26502\" class=\"wp-caption-text\">Ways to Implement Ternary Operator<\/p><\/div>\n<h4>1. Using Python Tuples<\/h4>\n<p><span style=\"font-weight: 400\">We can use tuples to specify what to do if the condition is True\/False.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; a,b=random(),random()\r\n&gt;&gt;&gt; (b,a)[a&gt;b]<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">0.8182650892806171<\/div>\n<p><span style=\"font-weight: 400\">This is equivalent to:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; (b,a)[True]<\/pre>\n<p><span style=\"font-weight: 400\">But we\u2019re confused which this is- a or b. Let\u2019s try tweaking this.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; (f\"b:{b}\",f\"a:{a}\")[a&gt;b]<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">&#8216;b:0.8182650892806171&#8217;<\/div>\n<p><span style=\"font-weight: 400\">That\u2019s more like it. Looking at the code, you\u2019ll reckon the first argument in the tuple corresponds to a Boolean value of False; the second- True. This is because of False=0 and True=1. The condition resides within the [ ].<\/span><\/p>\n<p><span style=\"font-weight: 400\">Note that this method evaluates both elements of the tuple, and hence is less efficient. This happens because it must first build the tuple before it can look for an index.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; condition=True\r\n&gt;&gt;&gt; 2 if condition else 1\/0    #Follows the normal if-else logic tree<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">2<\/div>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; (1\/0,2)[condition]<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Traceback (most recent call last):<br \/>\nFile &#8220;&lt;pyshell#48&gt;&#8221;, line 1, in &lt;module&gt;<br \/>\n(1\/0,2)[condition]<br \/>\nZeroDivisionError: division by zero<\/div>\n<h4>2. Using Python Dictionaries<\/h4>\n<p><span style=\"font-weight: 400\">Likewise, we can make this happen using dictionaries with the same logic.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; a,b=random(),random()\r\n&gt;&gt;&gt; {False:f\"b:{b}\",True:f\"a:{a}\"}[a&gt;b]<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">&#8216;a:0.37237928632774675&#8217;<\/div>\n<p><span style=\"font-weight: 400\">Since we specify what to do when here, we can interchange the positions of key-value pairs.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; {True:f\"a:{a}\",False:f\"b:{b}\"}[a&gt;b]<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">&#8216;a:0.37237928632774675&#8217;<\/div>\n<h4>3. Using a Lambda function in Python<\/h4>\n<p><span style=\"font-weight: 400\">We can also make use of Python Lambda Functions to act as a ternary operator.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; (lambda :f\"b:{b}\",lambda :f\"a:{a}\")[a&gt;b]()<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">&#8216;b:0.5955717855531699&#8217;<\/div>\n<h3>Nested Python Ternary Operator<\/h3>\n<p><span style=\"font-weight: 400\">Let\u2019s try chaining these operators, shall we?<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; a=random()\r\n&gt;&gt;&gt; \"Less than zero\" if a&lt;0 else \"Between 0 and 1\" if a&gt;=0 and a&lt;=1 else \"Greater than one\"<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">&#8216;Between 0 and 1&#8217;<\/div>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; a<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">0.8537574133103878<\/div>\n<p><span style=\"font-weight: 400\">Here, we check for the value of <\/span><i><span style=\"font-weight: 400\">a<\/span><\/i><span style=\"font-weight: 400\">. If it falls shorter than 0, we print \u201cLess than zero\u201d; if between 0 and 1, we print \u201cBetween 0 and 1\u201d. Else, we print \u201cGreater than one\u201d. Notice how we nested them.<\/span><\/p>\n<h3>Before Ternary Operators in Python<\/h3>\n<p><span style=\"font-weight: 400\">Before this was a thing with Python, this is what we did (we used a common idiom):<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; a,b=2,3\r\n&gt;&gt;&gt; a&lt;b and a or b<\/pre>\n<p><strong>Output<\/strong><\/p>\n<p>&nbsp;<\/p>\n<div class=\"code-output\">2<\/div>\n<p><span style=\"font-weight: 400\">So how does this work? Let\u2019s see.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">a is 2 and b is 3<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">It checks if a&lt;b<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">If true, it gives us True and a or b<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">This gives us a or b<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">It checks a<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">If false, it gives us False or b<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">This gives us b<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">This method, however, doesn\u2019t work for a=0. This is because that would be True and 0 or b, which is True and False or b, which is False or b, which is b. Oops!<\/span><\/p>\n<p><span style=\"font-weight: 400\">Now why don\u2019t you try formulating an expression for a&gt;b and try explaining it to yourself?<\/span><\/p>\n<p><span style=\"font-weight: 400\">It could also be beneficial to use the and\/or logic when one of our expressions is the same as the condition:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; def sayhello(): print('Hello')\r\n&gt;&gt;&gt; sayhello() if sayhello() else 'Bye'<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Hello<br \/>\nHello<br \/>\nTrue<\/div>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; sayhello() or 'Bye'<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Hello<br \/>\nTrue<\/div>\n<h3>Python Interview Questions on Ternary Operator<\/h3>\n<p>1. Does Python have a Ternary operator?<\/p>\n<p>2. How do you use a Python Ternary operator?<\/p>\n<p>3. Explain Python ternary operator with example?<\/p>\n<p>4. What is Python ternary operator symbol?<\/p>\n<p>5. Are Python ternary operators readable?<\/p>\n<h3>Conclusion<\/h3>\n<p><span style=\"font-weight: 400\">Phew! That\u2019s all. In this Python Ternary Operator blog, we tried our best to bring you everything there is to know about the ternary operator in Python. Moreover, we discussed implementing Ternary Operators in Python. <\/span><\/p>\n<p><span style=\"font-weight: 400\">If you\u2019d like us to write about something that has to do with Python (and we haven\u2019t already), please let us know in the comments below. We are excited to hear from you!<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today, we will see the Python Ternary Operator. Moreover, we will discuss the example and syntax of the Ternary Operator in Python. Also, we will learn about and nested Python Ternary Operators. At last,&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":26495,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[9042,10360,10443,10589,10590,10884,10886,33547],"class_list":["post-26459","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-nested-ternary-operator-in-python","tag-python-and-or","tag-python-conditional-expression","tag-python-if-else","tag-python-if-statement","tag-python-ternary","tag-python-ternary-without-else","tag-ternary-operator-in-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python Ternary Operator - 5 Ways To Implement Ternary Operators - DataFlair<\/title>\n<meta name=\"description\" content=\"This Python Ternary Operator Tutorial explains what a Ternary Operator is in Python, Python Ternary without else, and Python If-else.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/python-ternary-operator\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Ternary Operator - 5 Ways To Implement Ternary Operators - DataFlair\" \/>\n<meta property=\"og:description\" content=\"This Python Ternary Operator Tutorial explains what a Ternary Operator is in Python, Python Ternary without else, and Python If-else.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/python-ternary-operator\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-08-28T00:15:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-28T05:43:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Python-Ternary-Operator-01.jpg\" \/>\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\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Ternary Operator - 5 Ways To Implement Ternary Operators - DataFlair","description":"This Python Ternary Operator Tutorial explains what a Ternary Operator is in Python, Python Ternary without else, and Python If-else.","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:\/\/data-flair.training\/blogs\/python-ternary-operator\/","og_locale":"en_US","og_type":"article","og_title":"Python Ternary Operator - 5 Ways To Implement Ternary Operators - DataFlair","og_description":"This Python Ternary Operator Tutorial explains what a Ternary Operator is in Python, Python Ternary without else, and Python If-else.","og_url":"https:\/\/data-flair.training\/blogs\/python-ternary-operator\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-08-28T00:15:13+00:00","article_modified_time":"2026-04-28T05:43:51+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Python-Ternary-Operator-01.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/python-ternary-operator\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/python-ternary-operator\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"Python Ternary Operator &#8211; 5 Ways To Implement Ternary Operators","datePublished":"2018-08-28T00:15:13+00:00","dateModified":"2026-04-28T05:43:51+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-ternary-operator\/"},"wordCount":866,"commentCount":10,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-ternary-operator\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Python-Ternary-Operator-01.jpg","keywords":["Nested ternary Operator in python","Python and or","Python Conditional expression","Python If else","Python If Statement","Python Ternary","Python Ternary without else","ternary operator in python"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/python-ternary-operator\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/python-ternary-operator\/","url":"https:\/\/data-flair.training\/blogs\/python-ternary-operator\/","name":"Python Ternary Operator - 5 Ways To Implement Ternary Operators - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-ternary-operator\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-ternary-operator\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Python-Ternary-Operator-01.jpg","datePublished":"2018-08-28T00:15:13+00:00","dateModified":"2026-04-28T05:43:51+00:00","description":"This Python Ternary Operator Tutorial explains what a Ternary Operator is in Python, Python Ternary without else, and Python If-else.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/python-ternary-operator\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/python-ternary-operator\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/python-ternary-operator\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Python-Ternary-Operator-01.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/08\/Python-Ternary-Operator-01.jpg","width":1200,"height":628,"caption":"Python Ternary Operator - Implementation With Example"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/python-ternary-operator\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Python Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/python\/"},{"@type":"ListItem","position":3,"name":"Python Ternary Operator &#8211; 5 Ways To Implement Ternary Operators"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/26459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=26459"}],"version-history":[{"count":21,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/26459\/revisions"}],"predecessor-version":[{"id":147978,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/26459\/revisions\/147978"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/26495"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=26459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=26459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=26459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}