

{"id":6007,"date":"2018-01-17T09:48:38","date_gmt":"2018-01-17T04:18:38","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=6007"},"modified":"2026-04-28T14:40:42","modified_gmt":"2026-04-28T09:10:42","slug":"python-decorator","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/python-decorator\/","title":{"rendered":"Python Decorator &#8211; Chaining Decorators, Python Pie Syntax"},"content":{"rendered":"<p>In this Python Decorator tutorial, we will study what a decorator is in Python and why we use Python Nested Functions.<\/p>\n<p>Along with this, we will learn Python Decorators with Parameters and Python Pie Syntax. At last, we will study Chaining Decorators in the Python programming language.<\/p>\n<p>In Python, a function is a first-class object. This means that you can pass it around with absolute ease.<\/p>\n<p>You can return it, and even pass it as an argument to another. You can also nest a Python function inside another.<\/p>\n<p>So, let&#8217;s start the Python Decorator Tutorial.<\/p>\n<h3>What is a Python Decorator?<\/h3>\n<p>Python Decorator function is a function that adds functionality to another, but does not modify it. In other words, a Python Decorator wraps another function.<\/p>\n<p><strong>Advantages of decorators in Python:<\/strong><\/p>\n<ul>\n<li><strong>Saves time:<\/strong> You write a feature once, and you can use it in different functions instead of writing it again and again.<\/li>\n<li><strong>Cleaner code:<\/strong> You can keep your main code simple by removing the extra things.<\/li>\n<li><strong>Simple accessibility:<\/strong> It is now easy to access a feature by simply adding or removing on line.<\/li>\n<\/ul>\n<p>In the rest of the lesson, we will see the Python syntax of a Python decorator in detail. This is useful in cases when you want to add functionality to a function, but don\u2019t want to modify it for the same.<\/p>\n<p>Let\u2019s take a look.<\/p>\n<h3>A Simple Python Decorator<\/h3>\n<p>Talking about Python decorators for the first time can be confusing. So we begin with a very simple example with no arguments.<\/p>\n<p>Take this code.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; def decor(func):\r\n\tdef wrap():\r\n\t\tprint(\"$$$$$$$$$$$$$$$$$$$$$$\")\r\n\t\tfunc()\r\n\t\tprint(\"$$$$$$$$$$$$$$$$$$$$$$\")\r\n\treturn wrap\r\n&gt;&gt;&gt; def sayhello():\r\n          print(\"Hello\")\r\n&gt;&gt;&gt; newfunc=decor(sayhello)\r\n&gt;&gt;&gt; newfunc()<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">\n<p>$$$$$$$$$$$$$$$$$$$$$$<\/p>\n<p>Hello<\/p>\n<p>$$$$$$$$$$$$$$$$$$$$$$<\/p>\n<\/div>\n<p>Now let\u2019s see each part of the syntax one by one.<\/p>\n<h4>1. Python Decorator Function<\/h4>\n<p>First, we define a simple function sayhello() that prints out \u201cHello\u201d. Now, we\u2019ll define the decorator function in Python.<\/p>\n<p>You can call this anything; it doesn\u2019t have to be \u2018decor\u2019. This is a higher order function. Note that the relative order of these functions does not matter.<\/p>\n<p>You could define sayhello() before defining decor(), and it wouldn\u2019t make a difference. Let\u2019s discuss the decor function in detail.<\/p>\n<p><strong>def decor(func):<\/strong><\/p>\n<p>The first thing to notice here is that it takes a function as an argument. This is the function that we want to decorate.<\/p>\n<p>We want to call it func; you may want to call it something else. Inside this function, we nest a function, and we call it wrap().<\/p>\n<p>Again, you can call it anything you want.<\/p>\n<h4>2. The nested wrap function<\/h4>\n<p>It is inside this function that we put our extra functionality, and also call the function to be decorated.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">def wrap():\r\n           print(\"$$$$$$$$$$$$$$$$$$$$$$\")\r\n           func()\r\n           print(\"$$$$$$$$$$$$$$$$$$$$$$\")<\/pre>\n<p>Here, we used some print statements. It could have been anything else too, like an if-block.<\/p>\n<p>Finally, we make the decor() function return the wrap function.<\/p>\n<p>return wrap<\/p>\n<p>Why do we do this? We\u2019ll discuss this further in this lesson.<\/p>\n<h4>3. Assigning and Calling Python Decorator<\/h4>\n<p>Finally, we assign this Python decorator to a variable\u00a0and pass the function to be decorated as an argument to the decorating function.<\/p>\n<p><strong>newfunc=decor(sayhello)<\/strong><\/p>\n<p>Then, we call the function using parentheses after the variable to which we assign the decorators in Python.<\/p>\n<p><strong>newfunc()<\/strong><\/p>\n<p>However, you can also assign this to the function to be decorated itself. This will reassign it. Let\u2019s see that as well.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; def sayhello():\r\n          print(\"Hello\")\r\n&gt;&gt;&gt; def decor(func):\r\n\tdef wrap():\r\n\t\tprint(\"$\")\r\n\t\tfunc()\r\n\t\tprint(\"$\")\r\n\treturn wrap\r\n&gt;&gt;&gt; sayhello=decor(sayhello)\r\n&gt;&gt;&gt; sayhello()<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">\n<p>$<\/p>\n<p>Hello<\/p>\n<p>$<\/p>\n<\/div>\n<h3>Why use a Python Nested Function?<\/h3>\n<p>When I was attempting to understand Python decorators, this question totally confused me. Why do we use the wrap function, and then return it?<\/p>\n<p>Couldn\u2019t we simply write the code inside the decor function? So I ended up on the interpreter, trying it out.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; def decor(func):\r\n         print(\"$\")\r\n         func()\r\n         print(\"$\")\r\n&gt;&gt;&gt; def sayhello():\r\n         print(\"Hello\")<\/pre>\n<p>Here, we wrote the extra functionality right inside our decor() function. Now, let\u2019s try to assign it to a variable.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; newfunc=decor(sayhello)<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">\n<p>$<\/p>\n<p>Hello<\/p>\n<p>$<\/p>\n<\/div>\n<p>Woah. Why did it print it out? This is because decor() calls a function (here, func) instead of returning a value.<\/p>\n<p>When we use wrap (or whatever you\u2019d call it), and then return it, we can store it in a variable. Then, we can use that name to call the decorated function whenever we want.<\/p>\n<p>Now let\u2019s call the newfunc() function.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; newfunc()<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">\n<p>Traceback (most recent call last):File &#8220;&lt;pyshell#70&gt;&#8221;, line 1, in &lt;module&gt;<\/p>\n<p>newfunc()<\/p>\n<p>TypeError: &#8216;NoneType&#8217; object is not callable<\/p>\n<\/div>\n<p>As you can see, since decor did not return a value, the line of assignment did not assign the decorated function to newfunc. This is why it isn\u2019t callable.<\/p>\n<p>So, it is impossible to access this Python decorator again except for the following method:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; decor(sayhello)<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">\n<p>$<\/p>\n<p>Hello<\/p>\n<p>$<\/p>\n<\/div>\n<p>Finally, let\u2019s try calling our original function sayhello().<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; sayhello()<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Hello<\/div>\n<p>Works perfectly. See, decor() did not modify sayhello().<\/p>\n<p>We use the same example everywhere, so you can focus on what\u2019s being explained and not be invested in trying to understand the code.<\/p>\n<h3>Python Decorator with Parameters<\/h3>\n<p>So far, we\u2019ve only seen decorators in Python with regular print statements. Now, let\u2019s get into the real thing.<\/p>\n<p>To see how decorators fare with parameters, we\u2019ll take the example of a function that divides two values. All that our function does is to return the division of two numbers.<\/p>\n<p>But when we decorate it, we add functionality to deal with the situation where the denomination is 0. Watch how.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; def divide(a,b):\r\n          return a\/b\r\n&gt;&gt;&gt; def decorator(func):\r\n          def wrapper(a,b):\r\n                 if b==0:\r\n                     print(\"Can't divide by 0!\")\r\n                     return\r\n                 return func(a,b)\r\n          return wrapper<\/pre>\n<p>Like you can see, the Python decorator function takes one argument for the function to decorate. The wrapper here takes the same arguments as the function to decorate.<\/p>\n<p>Finally, we return the function to be decorated instead of calling it. This is because we want to return a value here from the divide() to the wrapper() to the decorator().<\/p>\n<h4>1. Python Closure<\/h4>\n<p>When we call func, it remembers the value of func from the argument to the function decorator(). This is called closure in Python.<\/p>\n<p>Here\u2019s another example to clear this up.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; msg=\"Hello\"\r\n&gt;&gt;&gt; def func1(msg):\r\n         def func2():\r\n              print(msg)\r\n         func2()\r\n\r\n&gt;&gt;&gt; func1(msg)<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Hello<\/div>\n<p>Also, note that if we called func(a,b) instead of returning it, we\u2019d get this:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; divide(2,3)\r\n&gt;&gt;&gt; print(divide(2,3))<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">None<\/div>\n<p>Now, let\u2019s assign and call.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; divide=decorator(divide)\r\n&gt;&gt;&gt; divide(2,3)<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">0.6666666666666666<\/div>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; divide(2,0)<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Can&#8217;t divide by 0!<\/div>\n<p>Problem Solved.<\/p>\n<h4>2. *args and **kwargs in Python<\/h4>\n<p>If you don\u2019t want to type in the whole list of arguments for the two statements, *args and **kwargs will do the trick for you.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; def divide(a,b):\r\n         return a\/b\r\n&gt;&gt;&gt; def decorate(func):\r\n         def wrapper(*args,**kwargs):\r\n            if args[1]==0:\r\n                 print(\"Can't divide by 0!\")\r\n                 return\r\n              return func(*args,**kwargs)\r\n           return wrapper\r\n\r\n&gt;&gt;&gt; divide=decorate(divide)\r\n&gt;&gt;&gt; divide(2,0)<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Can&#8217;t divide by 0!<\/div>\n<p>See, it works. Actually, *args is a tuple of arguments, and **kwargs is a dictionary of keyword arguments.<\/p>\n<p>Any Doubt yet in Python 3 Decorators? Please ask in comments.<\/p>\n<h3>Pie Syntax in Python<\/h3>\n<p>If you feel the assignment and calling statements are unnecessary, we\u2019ve got the pie syntax for you.<\/p>\n<p>It\u2019s simple; name the decorating function after the @ symbol, and put this before the function to decorate.<\/p>\n<p>Here\u2019s an example.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; @decor\r\ndef sayhello():\r\n       print(\"Hello\")\r\n&gt;&gt;&gt; sayhello()<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">\n<p>$$<\/p>\n<p>Hello<\/p>\n<p>$$<\/p>\n<\/div>\n<h3>Chaining Decorators in Python<\/h3>\n<p>You don\u2019t have to settle with just one Python decorator. That\u2019s the beauty of the pie syntax. Let\u2019s see how.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; def decor1(func):\r\n        def wrap():\r\n               print(\"$$$$$$$$$$$$$$\")\r\n               func()\r\n               print(\"$$$$$$$$$$$$$$\")\r\n        return wrap\r\n\r\n&gt;&gt;&gt; def decor2(func):\r\n        def wrap():\r\n               print(\"##############\")\r\n               func()\r\n               print(\"##############\")\r\n        return wrap<\/pre>\n<p>Now, let\u2019s define the sayhello() function. We\u2019ll use decor1 and decor2 on this.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; @decor1\r\n@decor2\r\ndef sayhello():\r\n         print(\"Hello\")\r\n\r\n&gt;&gt;&gt; sayhello()<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">\n<p>$$$$$$$$$$$$$$<\/p>\n<h6>########<\/h6>\n<p>Hello<\/p>\n<h6>########<\/h6>\n<p>$$$$$$$$$$$$$$<\/p>\n<\/div>\n<p>Note how the octothorpes (#) are sandwiched by dollars ($)?<\/p>\n<p>This lends us an important piece of information- the order of the decorators in python in the pie syntax matters. Since we used decor1 first, we get the dollars first.<\/p>\n<p>This was all about the Python Decorator Tutorial.<\/p>\n<h3>Python Interview Questions on Decorators<\/h3>\n<p>1. What is a decorator in Python? Explain with an example.<\/p>\n<p>2. How do you create a decorator in Python?<\/p>\n<p>3. How do you decorate a class in Python?<\/p>\n<p>4. Where are Python decorators used?<\/p>\n<p>5. What do decorators do in Python?<\/p>\n<h3>Conclusion<\/h3>\n<p>A decorator is a function that takes another function and returns a new callable that usually adds a small behavior change\u2014logging, timing, caching\u2014while leaving the original code untouched.<\/p>\n<p>We also saw the pie syntax for the same. And now you know- anything that confuses you, you can conquer it by facing it, for you can\u2019t run forever.<\/p>\n<p>Escape isn\u2019t real. See you again.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this Python Decorator tutorial, we will study what a decorator is in Python and why we use Python Nested Functions. Along with this, we will learn Python Decorators with Parameters and Python Pie&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":35976,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[3644,3645,3647,10396,10453,10474],"class_list":["post-6007","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-decorator-arguments","tag-decorator-function-in-python","tag-decorators-in-python","tag-python-built-in-decorators","tag-python-custom-decorators","tag-python-decorators"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python Decorator - Chaining Decorators, Python Pie Syntax - DataFlair<\/title>\n<meta name=\"description\" content=\"Python Decorator - What is python decorators, python decorator functions, decorators with parameters, Pie syntax in python,chaining decorators in python\" \/>\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-decorator\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Decorator - Chaining Decorators, Python Pie Syntax - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Python Decorator - What is python decorators, python decorator functions, decorators with parameters, Pie syntax in python,chaining decorators in python\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/python-decorator\/\" \/>\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-01-17T04:18:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-28T09:10:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Decorators-in-Python-1.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=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Decorator - Chaining Decorators, Python Pie Syntax - DataFlair","description":"Python Decorator - What is python decorators, python decorator functions, decorators with parameters, Pie syntax in python,chaining decorators in python","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/python-decorator\/","og_locale":"en_US","og_type":"article","og_title":"Python Decorator - Chaining Decorators, Python Pie Syntax - DataFlair","og_description":"Python Decorator - What is python decorators, python decorator functions, decorators with parameters, Pie syntax in python,chaining decorators in python","og_url":"https:\/\/data-flair.training\/blogs\/python-decorator\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-01-17T04:18:38+00:00","article_modified_time":"2026-04-28T09:10:42+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Decorators-in-Python-1.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":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/python-decorator\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/python-decorator\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"Python Decorator &#8211; Chaining Decorators, Python Pie Syntax","datePublished":"2018-01-17T04:18:38+00:00","dateModified":"2026-04-28T09:10:42+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-decorator\/"},"wordCount":1319,"commentCount":3,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-decorator\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Decorators-in-Python-1.jpg","keywords":["decorator arguments","decorator function in python","decorators in python","python built in decorators","python custom decorators","python decorators"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/python-decorator\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/python-decorator\/","url":"https:\/\/data-flair.training\/blogs\/python-decorator\/","name":"Python Decorator - Chaining Decorators, Python Pie Syntax - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-decorator\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-decorator\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Decorators-in-Python-1.jpg","datePublished":"2018-01-17T04:18:38+00:00","dateModified":"2026-04-28T09:10:42+00:00","description":"Python Decorator - What is python decorators, python decorator functions, decorators with parameters, Pie syntax in python,chaining decorators in python","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/python-decorator\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/python-decorator\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/python-decorator\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Decorators-in-Python-1.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Decorators-in-Python-1.jpg","width":1200,"height":628,"caption":"Python Decorator"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/python-decorator\/#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 Decorator &#8211; Chaining Decorators, Python Pie Syntax"}]},{"@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\/6007","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=6007"}],"version-history":[{"count":19,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/6007\/revisions"}],"predecessor-version":[{"id":148009,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/6007\/revisions\/148009"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/35976"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=6007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=6007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=6007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}