

{"id":113166,"date":"2023-07-19T19:17:29","date_gmt":"2023-07-19T13:47:29","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=113166"},"modified":"2023-07-19T19:17:45","modified_gmt":"2023-07-19T13:47:45","slug":"python-flask","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/python-flask\/","title":{"rendered":"What is Python Flask?"},"content":{"rendered":"<p>In this tutorial, we will learn what is Python Flask and how to build web applications using it. We will cover the basics of Flask, including how to set up a Flask application, how to handle routes, how to use templates, and how to work with databases. Let&#8217;s start!!!<\/p>\n<h3>What is Python Flask?<\/h3>\n<p>Flask is a lightweight web framework that enables developers to create web applications in Python. It was created by Armin Ronacher in 2010 and is widely used by developers worldwide. Flask is a micro framework that allows developers to build web applications with minimal boilerplate code, making it easy to get started with web development in Python.<\/p>\n<h3>WSGI<\/h3>\n<p>The Web Server Gateway Interface (WSGI), also known as the Web Server Gateway, is a specification for a common interface between web servers and Python online applications or frameworks. No matter which web framework was used to create the Python applications, WSGI specifies a straightforward and universal interface that enables web servers and Python applications to interact. As a result, developers can easily transition between them without having to make significant changes to their code thanks to the WSGI specification, which promotes compatibility and portability between various web servers and frameworks.<\/p>\n<p>Additionally, it offers an abstraction layer between the application and server layers, which facilitates the development and testing of web apps. Overall, WSGI has developed into a significant standard for Python web development, allowing communication between various web stack components.<\/p>\n<h3>Jinja2<\/h3>\n<p>The Jinja2 Python library offers a template engine for creating HTML, XML, or other markup forms on the fly. It enables the creation of templates by developers that contain placeholders for dynamic content that can be quickly populated with data during runtime. For creating dynamic content in Python web applications, Jinja2 is a potent and adaptable utility that supports template inheritance, built-in filters, and custom extensions. It&#8217;s extensively used in well-known web frameworks like Flask and Django, and web developers like it because of how simple it is to use and how easily it can be extended.<\/p>\n<h3>Python Flask Installation<\/h3>\n<p>Before we can start using Flask, we need to install it. The easiest way to do this is to use pip, the package manager for Python. Open your terminal and enter the following command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">pip install flask\r\n<\/pre>\n<p>This will install Flask on your system, and you can now start building web applications using Flask.<\/p>\n<h3>Creating a Flask Application<\/h3>\n<p>To create a Flask application, we need to create a Python file and import the Flask module. Let&#8217;s create a file called app.py and enter the following code:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from flask import Flask\r\n\r\napp = Flask(__name__)\r\n\r\n@app.route('\/')\r\ndef hello_world():\r\n    return 'DataFlair!'\r\n<\/pre>\n<p>In this code, we imported the Flask module and created an instance of the Flask class called app. We also defined a route using the @app.route() decorator. The route we defined is the root route (\/), and it returns the string &#8216;Hello, World!&#8217; when the route is accessed.<\/p>\n<p>To run this application, we need to add the following lines of code to the end of the file:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">if __name__ == '__main__':\r\n    app.run()\r\n<\/pre>\n<p><strong>Output<\/strong>:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/07\/flask.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-114600\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/07\/flask.webp\" alt=\"flask\" width=\"1800\" height=\"954\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>This code checks if the current file is being run as the main program, and if it is, it starts the Flask development server using the app.run() method.<\/p>\n<p>To run the application, save the app.py file and run the following command in your terminal:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">python app.py\r\n<\/pre>\n<p>This will start the development server, and you can access the application by visiting http:\/\/localhost:5000 in your web browser.<\/p>\n<h3>Handling Routes in Python Flask<\/h3>\n<p>In Flask, routes are handled using the @app.route() decorator. This decorator is used to specify the URL that should trigger the function that follows it. Let&#8217;s look at an example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">@app.route('\/hello')\r\ndef hello():\r\n    return 'Hello, World!'\r\n<\/pre>\n<p>In this example, we defined a route \/hello and a function hello() that returns the string &#8216;Hello, World!&#8217; when the route is accessed.<\/p>\n<p>We can also use variables in our routes using angle brackets (&lt;variable_name&gt;). These variables can then be used in our functions. Let&#8217;s look at an example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">@app.route('\/user\/&lt;username&gt;')\r\ndef user(username):\r\n    return f'Hello, {username}!'\r\n<\/pre>\n<p>In this example, we defined a route \/user\/&lt;username&gt; and a function user() that takes a variable username and returns the string Hello, &lt;username&gt;!. When we visit the URL \/user\/john, the function will return the string Hello, john!.<\/p>\n<h3>Using Templates in Flask<\/h3>\n<p>In Flask, templates are used to create dynamic HTML pages. We can use templates to display data from our Flask application in a web page. To use templates in Flask, we need to create a templates folder in our project directory and add our HTML files to this folder.<\/p>\n<p>Let&#8217;s create a template called index.html in our templates folder:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n    &lt;title&gt;My Flask Application&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;h1&gt;Hello, {{ name }}!&lt;\/h1&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>In this template, we use the double curly braces ({{ }}) to define a placeholder for our data. We can pass data to this template from our Flask application using the render_template() function.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from flask import render_template\r\n\r\n@app.route('\/hello\/&lt;name&gt;')\r\ndef hello_name(name):\r\n    return render_template('index.html', name=name)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/07\/flask-introduction.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-114589\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/07\/flask-introduction.webp\" alt=\"flask introduction\" width=\"1800\" height=\"954\" \/><\/a><\/p>\n<p>In this example, we defined a new route \/hello\/&lt;name&gt; and a function hello_name() that takes a variable name and passes it to the index.html template using the render_template() function. When we visit the URL \/hello\/john, the function will pass the string john to the template, and it will display the message Hello, john!.<\/p>\n<h3>Key features of Python Flask<\/h3>\n<h4>1. Routing:<\/h4>\n<p>Routing refers to the process of mapping URLs to functions that handle HTTP requests. Flask provides a simple and flexible way to define routes using the @app.route() decorator. Here&#8217;s an example<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from flask import Flask\r\n\r\napp = Flask(__name__)\r\n\r\n@app.route('\/')\r\ndef hello():\r\n    return 'Hello, World!'\r\n<\/pre>\n<p>This code defines a route for the root URL \/ that responds with the string &#8216;Hello, World!&#8217;.<\/p>\n<h4>2. Templates:<\/h4>\n<p>Templates allow you to generate dynamic HTML pages by filling in placeholders with data from your Python code. Flask uses the Jinja2 template engine, which provides a powerful and flexible way to generate HTML. Here&#8217;s an example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from flask import Flask, render_template\r\n\r\napp = Flask(__name__)\r\n\r\n@app.route('\/hello\/&lt;name&gt;')\r\ndef hello(name):\r\n    return render_template('hello.html', name=name)\r\n<\/pre>\n<p>This code defines a route that takes a name parameter from the URL and passes it to a template called hello.html. The template might look something like this:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n    &lt;title&gt;Hello, {{ name }}!&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;h1&gt;Hello, {{ name }}!&lt;\/h1&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<h4>3. Request Handling:<\/h4>\n<p>Flask provides a simple way to handle incoming HTTP requests using the request object. This object contains information about the incoming request, such as the HTTP method, headers, and data. Here&#8217;s an example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from flask import Flask, request\r\n\r\napp = Flask(__name__)\r\n\r\n@app.route('\/login', methods=['POST'])\r\ndef login():\r\n    username = request.form['username']\r\n    password = request.form['password']\r\n    # do some authentication\r\n    return 'Welcome, {}!'.format(username)\r\n<\/pre>\n<p>This code defines a route that only responds to HTTP POST requests. When the form data is submitted to the \/login URL, the request object is used to extract the username and password fields from the form data.<\/p>\n<h4>4. Sessions:<\/h4>\n<p>Sessions allow you to store user-specific data across multiple requests. Flask provides a simple way to manage sessions using the session object. Here&#8217;s an example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from flask import Flask, session, redirect, url_for, request\r\n\r\napp = Flask(__name__)\r\napp.secret_key = 'super secret key'\r\n\r\n@app.route('\/login', methods=['POST'])\r\ndef login():\r\n    session['username'] = request.form['username']\r\n    return redirect(url_for('profile'))\r\n\r\n@app.route('\/profile')\r\ndef profile():\r\n    username = session['username']\r\n    return 'Welcome, {}!'.format(username)\r\n<\/pre>\n<p>This code defines a route that stores the username field from the login form in the session, then redirects to the \/profile URL. The profile route then reads the username field from the session and displays a welcome message.<\/p>\n<h4>5. Debugging:<\/h4>\n<p>Debugging is an essential feature for any web framework. Flask provides a built-in debugger that allows you to inspect and modify variables, view stack traces, and more. Here&#8217;s an example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from flask import Flask\r\n\r\napp = Flask(__name__)\r\napp.config['DEBUG'] = True\r\n\r\n@app.route('\/')\r\ndef hello():\r\n    name = 'John'\r\n    age = 30\r\n    return 'Hello, {}. You are {} years old.'.format(name, age)\r\n\r\nif __name__ == '__main__':\r\n    app.run()\r\n<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/07\/flask-application.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-114591\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/07\/flask-application.webp\" alt=\"flask application\" width=\"1812\" height=\"960\" \/><\/a><\/p>\n<p>This code sets the DEBUG configuration option to True, which enables the built-in debugger. If an error occurs in the code, the debugger will display a detailed stack trace, allowing you to identify and fix the problem quickly.<\/p>\n<h3>Uses of Flask<\/h3>\n<p>Flask is a lightweight and flexible web framework for building web applications in Python. Here are some of the common uses of Flask<\/p>\n<h4>1. Building REST APIs:<\/h4>\n<p>Flask is a popular choice for building REST APIs because of its simplicity and flexibility. Here&#8217;s an example of how to create a simple REST API with Flask:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from flask import Flask, jsonify\r\n\r\napp = Flask(__name__)\r\n\r\n@app.route('\/api\/users')\r\ndef get_users():\r\n    users = [\r\n        {'id': 1, 'name': 'John'},\r\n        {'id': 2, 'name': 'Jane'},\r\n        {'id': 3, 'name': 'Bob'}\r\n    ]\r\n    return jsonify(users)\r\n\r\nif __name__ == '__main__':\r\n    app.run()\r\n<\/pre>\n<h4>2. Building web applications:<\/h4>\n<p>Flask is also a great choice for building web applications, including simple websites and more complex applications. Here&#8217;s an example of how to create a simple web application with Flask:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from flask import Flask, render_template\r\n\r\napp = Flask(__name__)\r\n\r\n@app.route('\/')\r\ndef index():\r\n    return render_template('index.html')\r\n\r\n@app.route('\/about')\r\ndef about():\r\n    return render_template('about.html')\r\n\r\nif __name__ == '__main__':\r\n    app.run()\r\n<\/pre>\n<h4>3. Working with databases:<\/h4>\n<p>Flask makes it easy to work with databases, including popular choices like SQLite, MySQL, and PostgreSQL. Here&#8217;s an example of how to connect to a SQLite database and retrieve data with Flask:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from flask import Flask, jsonify\r\nimport sqlite3\r\n\r\napp = Flask(__name__)\r\n\r\n@app.route('\/api\/users')\r\ndef get_users():\r\n    conn = sqlite3.connect('example.db')\r\n    cur = conn.cursor()\r\n    cur.execute('SELECT id, name FROM users')\r\n    users = [dict(id=row[0], name=row[1]) for row in cur.fetchall()]\r\n    conn.close()\r\n    return jsonify(users)\r\n\r\nif __name__ == '__main__':\r\n    app.run()\r\n<\/pre>\n<h3>Conclusion<\/h3>\n<p>In conclusion, Flask is a powerful and versatile web framework for building web applications in Python. It is lightweight and flexible, making it easy to get started with, but also capable of handling complex web development tasks.<\/p>\n<p>In this tutorial, we have covered the basics of Flask, including how to create routes, use templates, work with databases etc. By understanding these concepts, you can start building your own web applications with Flask.<\/p>\n<p>However, this tutorial is just scratching the surface of what is possible with Flask. There are many advanced features and libraries available for Flask that can help you build even more complex web applications<\/p>\n<p>Overall, Flask is a great choice for web development in Python, and with the right knowledge and tools, you can create powerful and effective web applications.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will learn what is Python Flask and how to build web applications using it. We will cover the basics of Flask, including how to set up a Flask application, how&#46;&#46;&#46;<\/p>\n","protected":false},"author":581,"featured_media":116547,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27373],"tags":[27590,27589],"class_list":["post-113166","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-flask-tutorials","tag-features-of-python-flask","tag-what-is-flask-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is Python Flask? - DataFlair<\/title>\n<meta name=\"description\" content=\"Flask is a powerful &amp; versatile web framework for building web applications in Python. See its features, installation, applications, uses etc\" \/>\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-flask\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is Python Flask? - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Flask is a powerful &amp; versatile web framework for building web applications in Python. See its features, installation, applications, uses etc\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/python-flask\/\" \/>\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=\"2023-07-19T13:47:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-19T13:47:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/07\/what-is-python-flask-1.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=\"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=\"7 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is Python Flask? - DataFlair","description":"Flask is a powerful & versatile web framework for building web applications in Python. See its features, installation, applications, uses etc","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-flask\/","og_locale":"en_US","og_type":"article","og_title":"What is Python Flask? - DataFlair","og_description":"Flask is a powerful & versatile web framework for building web applications in Python. See its features, installation, applications, uses etc","og_url":"https:\/\/data-flair.training\/blogs\/python-flask\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2023-07-19T13:47:29+00:00","article_modified_time":"2023-07-19T13:47:45+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/07\/what-is-python-flask-1.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/python-flask\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/python-flask\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445"},"headline":"What is Python Flask?","datePublished":"2023-07-19T13:47:29+00:00","dateModified":"2023-07-19T13:47:45+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-flask\/"},"wordCount":1453,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-flask\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/07\/what-is-python-flask-1.webp","keywords":["features of Python flask","What is Flask Python?"],"articleSection":["Python Flask Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/python-flask\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/python-flask\/","url":"https:\/\/data-flair.training\/blogs\/python-flask\/","name":"What is Python Flask? - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-flask\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-flask\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/07\/what-is-python-flask-1.webp","datePublished":"2023-07-19T13:47:29+00:00","dateModified":"2023-07-19T13:47:45+00:00","description":"Flask is a powerful & versatile web framework for building web applications in Python. See its features, installation, applications, uses etc","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/python-flask\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/python-flask\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/python-flask\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/07\/what-is-python-flask-1.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/07\/what-is-python-flask-1.webp","width":1200,"height":628,"caption":"what is python flask"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/python-flask\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Python Flask Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/python-flask-tutorials\/"},{"@type":"ListItem","position":3,"name":"What is Python Flask?"}]},{"@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\/c187795dc82ab948373cca526df7c445","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam6\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/113166","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\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=113166"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/113166\/revisions"}],"predecessor-version":[{"id":116548,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/113166\/revisions\/116548"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/116547"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=113166"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=113166"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=113166"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}