

{"id":120590,"date":"2023-11-16T18:00:55","date_gmt":"2023-11-16T12:30:55","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=120590"},"modified":"2023-11-16T18:27:42","modified_gmt":"2023-11-16T12:57:42","slug":"what-are-sets-in-swift","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/what-are-sets-in-swift\/","title":{"rendered":"What are Sets in Swift"},"content":{"rendered":"<p>Sets are a type of collection data type in Swift. It stores unique elements without any order. A set cannot contain duplicate characters in it. In this article, we\u2019ll discuss how to create and use sets in Swift. We\u2019ll also learn concepts related to sets with the help of relevant examples.<\/p>\n<h2>Create a Set in Swift<\/h2>\n<p>We can create a set by mentioning the data type Set in the type annotation while declaring a set variable.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var setExample: Set = [12, 61, 23, 78]\r\nprint(setExample)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>[23, 61, 78, 12]<\/p>\n<p>We can also define the data type of the elements in the set. We can do it by enclosing the data type of the elements within angular brackets &lt;&gt;.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var setExample: Set&lt;Int&gt; = [12, 61, 23, 78]\r\nprint(setExample)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>[78, 61, 23, 12]<\/p>\n<p>We can also create a set instance and assign values it to later.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var setExample = Set&lt;Int&gt;()<\/pre>\n<h3>Access and Modify Set elements<\/h3>\n<p>We use the following properties and methods to access and modify the set and its elements.<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Property\/Method<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">count<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the total number of unique elements in the set<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">isEmpty<\/span><\/td>\n<td><span style=\"font-weight: 400\">Check if the given set is empty or not.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">insert(element)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Adds a new element to the set<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">contains(element)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Check if the set contains certain elements or not.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">remove(element)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Removes the element from the set<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">removeFirst(element)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Removes the element at first from the set<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">removeAll(element)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Removes all the elements from the set<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var setExample: Set = [\"DataFlair\", \"Swift\", \"Sets\", \"Collections\", \"Swift\"]\r\nprint(setExample)\r\n\/\/ checks set is empty or not\r\nprint(\"Set Empty?:\", setExample.isEmpty)    \r\n\/\/ insets new element to the set\r\nsetExample.insert(\"Programming\")\r\nprint(setExample)\r\n\/\/ returns the number of elements in the set that are unique\r\nprint(\"Set count:\", setExample.count)\r\n\/\/ removes element from the set\r\nsetExample.remove(\"Swift\")\r\nprint(setExample) \r\n\/\/ checks if the set contains the particular element\r\nprint(\"Set contains DataFlair?:\", setExample.contains(\"DataFlair\"))<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>[&#8220;Collections&#8221;, &#8220;Swift&#8221;, &#8220;Sets&#8221;, &#8220;DataFlair&#8221;]<br \/>\nSet Empty?: false<br \/>\n[&#8220;Collections&#8221;, &#8220;Swift&#8221;, &#8220;Sets&#8221;, &#8220;Programming&#8221;, &#8220;DataFlair&#8221;]<br \/>\nSet count: 5<br \/>\n[&#8220;Collections&#8221;, &#8220;Sets&#8221;, &#8220;Programming&#8221;, &#8220;DataFlair&#8221;]<br \/>\nSet contains DataFlair?: true<\/p>\n<h3>Methods for Sets in Swift<\/h3>\n<p>Swift offers other inbuilt methods for sets. T<strong>he table below depicts the same.<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Property\/Method<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">sorted()<\/span><\/td>\n<td><span style=\"font-weight: 400\">Sorts the elements in the set<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">forEach()<\/span><\/td>\n<td><span style=\"font-weight: 400\">Performs specific actions for every element in the set<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">randomElement()<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns a random element from the set<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">firstIndex()<\/span><\/td>\n<td><span style=\"font-weight: 400\">Return the index of the element from the set.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Loops and Sets<\/h3>\n<p>We use a for-in loop to iterate through the elements in a set.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var setExample: Set = [\"DataFlair\", \"Swift\", \"Sets\", \"Collections\"]\r\nfor element in setExample{\r\n    print(element)\r\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>Swift<br \/>\nSets<br \/>\nCollections<br \/>\nDataFlair<\/p>\n<h3>Set Operations<\/h3>\n<p>Swift provides inbuilt functions to perform set operations. Operations include the union of sets, the intersection of sets, a difference of sets and symmetric difference of sets. It is similar to mathematical set operations. <strong>Following explains these operations in detail.<\/strong><\/p>\n<h4>Union of sets<\/h4>\n<p>The operation union of sets includes all the elements from both sets. Since the final result is a set, no duplicate elements are present.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/union-of-sets.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-121353 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/union-of-sets.webp\" alt=\"union of sets\" width=\"200\" height=\"200\" \/><\/a><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var set1: Set = [23,25,27,29]\r\nvar set2: Set = [21, 25, 27]\r\n\r\nvar set3: Set = set1.union(set2)\r\nprint(set3)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>[23, 25, 27, 21, 29]<\/p>\n<h4>Intersection of sets<\/h4>\n<p>The operation intersection of sets includes only the common elements from both sets. Since the final result is a set, no duplicate elements are present.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/intersection-of-sets.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-121354 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/intersection-of-sets.webp\" alt=\"intersection of sets\" width=\"200\" height=\"200\" \/><\/a><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var set1: Set = [23,25,27,29]\r\nvar set2: Set = [21, 25, 27]\r\n\r\nvar set3: Set = set1.intersection(set2)\r\nprint(set3)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>[27, 25]<\/p>\n<h4>Difference of sets<\/h4>\n<p>The operation difference of sets results in a final set where all the elements present in the first set are included, but the ones also present in the second set are excluded.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/difference-of-sets.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-121351 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/difference-of-sets.webp\" alt=\"difference of sets\" width=\"200\" height=\"200\" \/><\/a><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var set1: Set = [23,25,27,29]\r\nvar set2: Set = [21, 25, 27]\r\n\r\nvar set3: Set = set1.subtracting(set2)\r\nvar set4: Set = set2.subtracting(set1)\r\nprint(set3)\r\nprint(set4)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>[29, 23]<br \/>\n[21]<\/p>\n<h4>Symmetric Difference of sets<\/h4>\n<p>The operation of the symmetric difference of sets results in a final set which includes all the elements of the first and second sets but excludes the elements common in both sets.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/symmetric-difference-of-sets.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-121352 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/symmetric-difference-of-sets.webp\" alt=\"symmetric difference of sets\" width=\"200\" height=\"200\" \/><\/a><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var set1: Set = [23,25,27,29]\r\nvar set2: Set = [21, 25, 27]\r\n\r\nvar set3: Set = set1.symmetricDifference(set2)\r\nprint(set3)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>[29, 21, 23]<\/p>\n<h3>Set Membership in Swift<\/h3>\n<p>Swift offers more methods for Swift to verify and test the membership of elements of a set.<\/p>\n<p><strong>The following table shows these methods and explains what they do.<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Method<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">contains(element)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Checks whether an element is present in a set or not<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">==\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400\">Check if the two sets are the same or not<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">isSubset(of:)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Check if a set consists of all elements of the given set in the parameter.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">isSuperset(of:)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Checks if the elements of the set are present in the given set or not<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">isStrictSubset(of:)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Check if the given set is a subset but not equal to the set.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">isStrictSuperset(of:)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Checks if the given set is a superset but not equal to the set.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">isDisjoint(with:)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Check if all the elements are different in the two sets<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var set1: Set = [41, 42, 43, 44, 45, 46, 47, 48]\r\nvar set2: Set = [42, 44, 45, 46, 48]\r\n\r\nprint(\"Contains 44 in set 1?\", set1.contains(42))\r\nprint(\"Contains 44 in set 2?\", set2.contains(42))\r\nprint(\"Are the sets equal?\", set1 == set2)\r\nprint(\"set1 subset of set2?\", set1.isSubset(of: set2))\r\nprint(\"set2 subset of set1?\", set2.isSubset(of: set1))\r\nprint(\"set1 superset of set2?\", set1.isSuperset(of: set2))\r\nprint(\"set2 superset of set1?\", set2.isSuperset(of: set1))\r\nprint(\"set1 strict subset of set2?\", set1.isStrictSubset(of: set2))\r\nprint(\"set2 strict subset of set1?\", set2.isStrictSubset(of: set1))\r\nprint(\"set1 strict superset of set2?\", set1.isStrictSuperset(of: set2))\r\nprint(\"set2 strict superset of set1?\", set2.isStrictSuperset(of: set1))\r\nprint(\"are the sets disjoint?\", set1.isDisjoint(with: set2))<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>Contain 44 in set 1? true<br \/>\nContain 44 in set 2? true<br \/>\nAre the sets equal? false<br \/>\nset1 subset of set2? false<br \/>\nset2 subset of set1? true<br \/>\nset1 superset of set2? true<br \/>\nset2 superset of set1? false<br \/>\nset1 strict subset of set2? false<br \/>\nset2 strict subset of set1? true<br \/>\nset1 strict superset of set2? true<br \/>\nset2 strict superset of set1? false<br \/>\nAre the sets disjoint? false<\/p>\n<h3>Conclusion<\/h3>\n<p>Swift provides a very unique collection type data type known as Set. It stores all unique elements of the same data type. Swift also offers several properties and methods to manipulate the elements in the sets based on our use. In this article, we have covered different ways to use Swift sets and their methods and properties to our convenience.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sets are a type of collection data type in Swift. It stores unique elements without any order. A set cannot contain duplicate characters in it. In this article, we\u2019ll discuss how to create and&#46;&#46;&#46;<\/p>\n","protected":false},"author":581,"featured_media":120592,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27789],"tags":[28450,28449,21771,28448,28282],"class_list":["post-120590","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-swift-tutorials","tag-set-operation","tag-sets-in-swift","tag-swift","tag-swift-sets","tag-swift-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What are Sets in Swift - DataFlair<\/title>\n<meta name=\"description\" content=\"Swift provides a very unique collection type data type known as Set. It stores all unique elements of the same data type.\" \/>\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\/what-are-sets-in-swift\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What are Sets in Swift - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Swift provides a very unique collection type data type known as Set. It stores all unique elements of the same data type.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/what-are-sets-in-swift\/\" \/>\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-11-16T12:30:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-16T12:57:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-sets.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=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What are Sets in Swift - DataFlair","description":"Swift provides a very unique collection type data type known as Set. It stores all unique elements of the same data type.","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\/what-are-sets-in-swift\/","og_locale":"en_US","og_type":"article","og_title":"What are Sets in Swift - DataFlair","og_description":"Swift provides a very unique collection type data type known as Set. It stores all unique elements of the same data type.","og_url":"https:\/\/data-flair.training\/blogs\/what-are-sets-in-swift\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2023-11-16T12:30:55+00:00","article_modified_time":"2023-11-16T12:57:42+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-sets.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":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/what-are-sets-in-swift\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/what-are-sets-in-swift\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445"},"headline":"What are Sets in Swift","datePublished":"2023-11-16T12:30:55+00:00","dateModified":"2023-11-16T12:57:42+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/what-are-sets-in-swift\/"},"wordCount":752,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/what-are-sets-in-swift\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-sets.webp","keywords":["set operation","sets in swift","Swift","swift sets","swift tutorial"],"articleSection":["Swift Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/what-are-sets-in-swift\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/what-are-sets-in-swift\/","url":"https:\/\/data-flair.training\/blogs\/what-are-sets-in-swift\/","name":"What are Sets in Swift - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/what-are-sets-in-swift\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/what-are-sets-in-swift\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-sets.webp","datePublished":"2023-11-16T12:30:55+00:00","dateModified":"2023-11-16T12:57:42+00:00","description":"Swift provides a very unique collection type data type known as Set. It stores all unique elements of the same data type.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/what-are-sets-in-swift\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/what-are-sets-in-swift\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/what-are-sets-in-swift\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-sets.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-sets.webp","width":1200,"height":628,"caption":"swift sets"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/what-are-sets-in-swift\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Swift Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/swift-tutorials\/"},{"@type":"ListItem","position":3,"name":"What are Sets in Swift"}]},{"@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\/120590","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=120590"}],"version-history":[{"count":4,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120590\/revisions"}],"predecessor-version":[{"id":126003,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120590\/revisions\/126003"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/120592"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=120590"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=120590"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=120590"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}