

{"id":20471,"date":"2018-07-08T04:05:13","date_gmt":"2018-07-07T22:35:13","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=20471"},"modified":"2026-04-25T16:01:19","modified_gmt":"2026-04-25T10:31:19","slug":"python-3-extension-programming","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/python-3-extension-programming\/","title":{"rendered":"Python 3 Extension Programming with C &amp; Others Languages"},"content":{"rendered":"<p>In our previous Python tutorial, we studied Python Database Access. Here, we will see Python 3 Extension Programming with C &amp; Others Languages.<\/p>\n<p>Moreover, we will study the structure of the Python Extension Module and the setup.py Script.<\/p>\n<p>Along with this, we will discuss how to import Python 3 Extension Programming and how to write extensions for Python.<\/p>\n<p>So, let\u2019s begin Python 3 Extension Programming.<\/p>\n<h3>Python 3 Extension Programming<\/h3>\n<p>Python 3 extension Programming is any code that we write in any other language, like C, C++, or Java. We can import or integrate it into a Python script. So, this tutorial is essentially one on how to write and import extensions for Python.<\/p>\n<p>Extensions let Python call C, C++, or Rust for heavy lifting. The oldest path is the C API: write C functions, expose them in a PyMethodDef, and compile a shared object that imports like a normal module.<\/p>\n<p>The .dll files (dynamically linked libraries) you may see on your Windows or the. So, files you notice on your Unix are libraries.<\/p>\n<p>In effect, extension modules are libraries.<\/p>\n<h3>Structure of Python 3 Extension Module<\/h3>\n<p><strong>A Python 3 extension Programming module will have the following parts:<\/strong><\/p>\n<ul>\n<li>Header file- python.h<\/li>\n<li>An initialization function.<\/li>\n<li>Functions in other languages.<\/li>\n<li>A table to map the names of the functions.<\/li>\n<\/ul>\n<p>Let\u2019s look at each of these one by one.<\/p>\n<div id=\"attachment_20493\" style=\"width: 1677px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Structure-of-python-Extension-Module-01.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-20493\" class=\"wp-image-20493 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Structure-of-python-Extension-Module-01.jpg\" alt=\"Python 3 Extension Programming with C &amp;amp; Others Languages\" width=\"1667\" height=\"872\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Structure-of-python-Extension-Module-01.jpg 1667w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Structure-of-python-Extension-Module-01-150x78.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Structure-of-python-Extension-Module-01-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Structure-of-python-Extension-Module-01-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Structure-of-python-Extension-Module-01-1024x536.jpg 1024w\" sizes=\"auto, (max-width: 1667px) 100vw, 1667px\" \/><\/a><p id=\"caption-attachment-20493\" class=\"wp-caption-text\">Python 3 Extension Programming with C &amp; Other Languages<\/p><\/div>\n<h4>1. Header File- python.h<\/h4>\n<p>Let\u2019s write a Python 3 extension for C. So, we must include this header file in our C source file. We put this include before all others.<\/p>\n<p>We also succeed this with the Python functions we want to call. This header file lets us access the internal Python API.<\/p>\n<p>In the Python header, all types and functions begin with the prefix \u2018Py\u2019\/\u2019PY\u2019. For parsing data between Python and C, we have the Python object pointer. This is the PyObject.<\/p>\n<p>Here\u2019s an example:<\/p>\n<p>static PyObject* myFunc(PyObject* self)<br \/>\nThis header file also has some other functions:<\/p>\n<ul>\n<li><strong>PyArg_ParseTuple(args, format, \u2026)-<\/strong> This gets arguments from Python.<\/li>\n<li><strong>Py_BuildValue(format, \u2026)-<\/strong> This turns values into PyObject pointers.<\/li>\n<li><strong>PyModule_Create(moduleDef)-<\/strong> This initializes the module; wraps method pointers using module definitions.<\/li>\n<\/ul>\n<p>For functions that return nothing, we use the value Py_None.<\/p>\n<p>The PyMethodDef contains the binding information. This structure ends with terminating NULL and 0 values.<\/p>\n<h4>2. Initialization Function<\/h4>\n<p>When the interpreter loads your extension module, it calls this function. This is the last part of the Python 3 extension.<\/p>\n<p>You should name this as follows- if you call your module \u2018Sound\u2019, then name this function \u2018initSound\u2019.<\/p>\n<p><strong>It will look like this:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">PyMODINIT_FUNC initModule() {\r\nPy_InitModule3(func, module_methods, docstring);\r\n}<\/pre>\n<p>Here, we have three parameters-<\/p>\n<ul>\n<li><strong>func-<\/strong> The function to export<\/li>\n<li><strong>module_methods-<\/strong> Mapping table<\/li>\n<li><strong>docstring-<\/strong> Comment<\/li>\n<\/ul>\n<h4>3. C Functions to Call<\/h4>\n<p><strong>We can use one of three forms to return a Python object:<\/strong><\/p>\n<ul>\n<li>static PyObject *MyFunction( PyObject *self, PyObject *args );<\/li>\n<li>static PyObject *MyFunctionWithKeywords(PyObject *self, PyObject *args, PyObject *kw);<\/li>\n<li>static PyObject *MyFunctionWithNoArgs( PyObject *self );<\/li>\n<\/ul>\n<p>When we use the Py_RETURN_NONE macro that the Python headers have to offer, we can have a function return None.<\/p>\n<p>This is equivalent to void in C. These are static functions. Here\u2019s an example-<\/p>\n<pre class=\"EnlighterJSRAW\">static PyObject * module_func(PyObject * self, PyObject * args)\r\n{\r\nchar * input;\r\nchar * result;\r\nPyObject * ret;\r\n\/\/Parsing arguments\r\nif(!PyArg_ParseTuple(args, \"s\", &amp;input)){\r\nreturn NULL;\r\n}\r\n\/\/Running actual function\r\nresult=hello(input);\r\n\/\/Building a Python object from this string\r\nret=PyString_FromString(result);\r\nfree(result);\r\nreturn ret;\r\n}<\/pre>\n<h4>4. Symbol\/ Mapping Table<\/h4>\n<p>You need to register the function(s) in a symbol table for a module. For Python, all functions live in a module- even C functions.<\/p>\n<p>This is a kind of PyMethodDef:<\/p>\n<pre class=\"EnlighterJSRAW\">static PyMethodDef module_methods[]={\r\n{\"my_func\", (PyCFunction)module_func, METH_NOARGS, NULL},\r\n{NULL, NULL, 0, NULL}\r\n};<\/pre>\n<p><strong>a. Parameters<\/strong><\/p>\n<p>Now here, we have four parameters-<\/p>\n<p><strong>i. Function name-<\/strong> How the interpreter presents it; here, it is my_func<\/p>\n<p><strong>ii. Function address-<\/strong> Here, it is (PyCFunction)module_func<\/p>\n<p><strong>iii. Flag-<\/strong> This can be of three kinds:<\/p>\n<ul>\n<li><strong>METH_VARARGS<\/strong><\/li>\n<li><strong>METH_NOARGS-<\/strong> No arguments<\/li>\n<li><strong>Bitwise OR with METH_KEYWORDS-<\/strong> For working with keyword arguments<\/li>\n<\/ul>\n<p><strong>iv. Docstring-<\/strong> When you don\u2019t want to provide one, you can use NULL.<\/p>\n<p>We terminate this with a sentinel holding the NULL and 0. In the example, we have used {NULL, NULL, 0, NULL}.<br \/>\nIn this table, we also put pointers to the C functions.<\/p>\n<h3>setup.py Script<\/h3>\n<p>After writing a Python-callable function, registering it in the module\u2019s symbol table, and writing an initialization function, we write a setup.py script.<br \/>\nfrom distutils. core import setup, Extension<br \/>\n<strong>#Extension module for C\/ C++<\/strong><br \/>\n<strong>extension_mod=Extension(&#8220;hello&#8221;, [&#8220;hellomodule.c&#8221;, &#8220;hello.c&#8221;])<\/strong><br \/>\n<strong>setup(name=&#8221;hello&#8221;, ext_modules=[extension_mod])<\/strong><\/p>\n<h3>Wrapping in Python<\/h3>\n<p>A wrapper is a function that calls another. Here, a wrapper binds a Python object to a C function.<\/p>\n<p>Let\u2019s see a couple of different ways to do this. So far, we\u2019ve only seen how to do this manually.<\/p>\n<div id=\"attachment_20494\" style=\"width: 1677px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Wrapping-01.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-20494\" class=\"wp-image-20494 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Wrapping-01.jpg\" alt=\"Python 3 Extension Programming with C &amp; Others Languages\" width=\"1667\" height=\"872\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Wrapping-01.jpg 1667w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Wrapping-01-150x78.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Wrapping-01-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Wrapping-01-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Wrapping-01-1024x536.jpg 1024w\" sizes=\"auto, (max-width: 1667px) 100vw, 1667px\" \/><\/a><p id=\"caption-attachment-20494\" class=\"wp-caption-text\">Python 3 Extension Programming with C &amp; Other Languages<\/p><\/div>\n<h4>1. SWIG<\/h4>\n<p>SWIG is an acronym for Simple Wrapper Interface Generator. While it supports many languages, let\u2019s consider Python for now.<\/p>\n<p><strong>a. A makefile<\/strong><br \/>\nall:<br \/>\nswig -python -c++ -o _swigdemo_module.cc swigdemo.i<br \/>\npython setup.py build_ext \u2013inplace<\/p>\n<p><strong>b. SWIG wrapper file<\/strong><br \/>\n%module swigdemo<br \/>\n%{<br \/>\n#include &lt;stdlib.h&gt;<br \/>\n#include &#8220;hello.h&#8221;<br \/>\n%}<br \/>\n%include &#8220;hello.h&#8221;<\/p>\n<p><strong>c. setup.py script<\/strong><br \/>\nfrom distutils.core import setup, Extension<br \/>\nextension_mod = Extension(&#8220;_swigdemo&#8221;, [&#8220;_swigdemo_module.cc&#8221;, &#8220;hello.c&#8221;])<br \/>\nsetup(name = &#8220;swigdemo&#8221;, ext_modules=[extension_mod])<\/p>\n<h4>2. Pyrex<\/h4>\n<p>Pyrex is a hybrid of C and Python. Let\u2019s try wrapping with this.<\/p>\n<p><strong>a. .pyx file<\/strong><br \/>\ncdef extern from &#8220;hello.h&#8221;:<br \/>\nchar * hello(char *str)\u00a0 #This takes the symbol \u2018hello\u2019 from hello.h.<br \/>\ndef hello_fn(str):<br \/>\nreturn hello(str)<\/p>\n<p><strong>b. setup.py file<\/strong><br \/>\nfrom distutils.core import setup<br \/>\nfrom distutils.extension import Extension<br \/>\nfrom Pyrex.Distutils import build_ext<br \/>\nsetup(<br \/>\nname=&#8221;hello&#8221;,<br \/>\next_modules=[ Extension(&#8220;hellomodule&#8221;, [&#8220;hellomodule.pyx&#8221;, &#8220;hello.c&#8221;]) ],<br \/>\ncmdclass={&#8216;build_ext&#8217;: build_ext}<br \/>\n)<\/p>\n<h3>How to Import Python 3 Extension<\/h3>\n<p>You can import an extension as you\u2019d normally import a module in Python-<br \/>\n<strong>import module_func<\/strong><br \/>\n<strong>print(module_func.my_func())<\/strong><br \/>\nSo, this was all about Python 3 Extension Programming. Hope you like our explanation.<\/p>\n<h3>Python Interview Questions on Extension Programming<\/h3>\n<p>1. What is the extension of a Python program?<\/p>\n<p>2. What is the extension of a Python library module?<\/p>\n<p>3. Which filename extensions are associated with Python?<\/p>\n<p>4. Can Python and C++ work together?<\/p>\n<p>5. What is a Python C Extension?<\/p>\n<h3>Conclusion<\/h3>\n<p>Hence, in this Python Extension tutorial, we saw how to perform extension programming using C and Python.<\/p>\n<p>You are now writing a code that is simple, like a conversation, but runs with the lightning speed of a machine. You are now not just a user of libraries; you have a great understanding of how the engines of the software world are actually built.<\/p>\n<p>In addition, we learned\u00a0how to import Python 3 Extension Programming and how to write extensions for Python. That\u2019s all for today.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In our previous Python tutorial, we studied Python Database Access. Here, we will see Python 3 Extension Programming with C &amp; Others Languages. Moreover, we will study the structure of the Python Extension Module&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":20492,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[108,157,2262,2275,4133,4500,5601,6712,10267,10284,10331,10338,10400,10401,10530,12665,12804,14013,14014,14021,16288],"class_list":["post-20471","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-pyx-file","tag-a-makefile","tag-c-functions-to-call","tag-calling-c-from-python","tag-embedding-python-in-c-example","tag-extending-python-with-c","tag-header-file-python-h","tag-initialization-function","tag-pymodule_create","tag-pyrex","tag-pystring_fromstring-python-3","tag-python-3-file-extension","tag-python-c-api-tutorial","tag-python-c-extension-example","tag-python-extend","tag-se-setup-py-script","tag-setup-py-script","tag-swig","tag-swig-wrapper-file","tag-symbol-mapping-table","tag-wrapping"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python 3 Extension Programming with C &amp; Others Languages - DataFlair<\/title>\n<meta name=\"description\" content=\"Python 3 extension Programming is any code that we write in any other language, like C, C++, or Java. Let\u2019s begin.\" \/>\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-3-extension-programming\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python 3 Extension Programming with C &amp; Others Languages - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Python 3 extension Programming is any code that we write in any other language, like C, C++, or Java. Let\u2019s begin.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/python-3-extension-programming\/\" \/>\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-07-07T22:35:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-25T10:31:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-3-Extension-Programming-01.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1667\" \/>\n\t<meta property=\"og:image:height\" content=\"872\" \/>\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 3 Extension Programming with C &amp; Others Languages - DataFlair","description":"Python 3 extension Programming is any code that we write in any other language, like C, C++, or Java. Let\u2019s begin.","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-3-extension-programming\/","og_locale":"en_US","og_type":"article","og_title":"Python 3 Extension Programming with C &amp; Others Languages - DataFlair","og_description":"Python 3 extension Programming is any code that we write in any other language, like C, C++, or Java. Let\u2019s begin.","og_url":"https:\/\/data-flair.training\/blogs\/python-3-extension-programming\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-07-07T22:35:13+00:00","article_modified_time":"2026-04-25T10:31:19+00:00","og_image":[{"width":1667,"height":872,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-3-Extension-Programming-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":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/python-3-extension-programming\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/python-3-extension-programming\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"Python 3 Extension Programming with C &amp; Others Languages","datePublished":"2018-07-07T22:35:13+00:00","dateModified":"2026-04-25T10:31:19+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-3-extension-programming\/"},"wordCount":1111,"commentCount":2,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-3-extension-programming\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-3-Extension-Programming-01.jpg","keywords":[".pyx file","A makefile","C Functions to Call","calling c from python","embedding python in c++ example","extending python with c++","Header File- python.h","Initialization Function","pymodule_create","Pyrex","pystring_fromstring python 3","python 3 file extension","python c api tutorial","python c extension example","python extend","se setup.py Script","setup.py script","SWIG","SWIG wrapper file","Symbol\/ Mapping Table","Wrapping"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/python-3-extension-programming\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/python-3-extension-programming\/","url":"https:\/\/data-flair.training\/blogs\/python-3-extension-programming\/","name":"Python 3 Extension Programming with C &amp; Others Languages - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-3-extension-programming\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-3-extension-programming\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-3-Extension-Programming-01.jpg","datePublished":"2018-07-07T22:35:13+00:00","dateModified":"2026-04-25T10:31:19+00:00","description":"Python 3 extension Programming is any code that we write in any other language, like C, C++, or Java. Let\u2019s begin.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/python-3-extension-programming\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/python-3-extension-programming\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/python-3-extension-programming\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-3-Extension-Programming-01.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-3-Extension-Programming-01.jpg","width":1667,"height":872,"caption":"Python 3 Extension Programming with C &amp; Others Languages"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/python-3-extension-programming\/#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 3 Extension Programming with C &amp; Others Languages"}]},{"@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\/20471","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=20471"}],"version-history":[{"count":12,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/20471\/revisions"}],"predecessor-version":[{"id":147915,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/20471\/revisions\/147915"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/20492"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=20471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=20471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=20471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}