

{"id":120587,"date":"2023-11-18T18:00:26","date_gmt":"2023-11-18T12:30:26","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=120587"},"modified":"2023-11-18T18:09:54","modified_gmt":"2023-11-18T12:39:54","slug":"swift-dictionaries","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/swift-dictionaries\/","title":{"rendered":"Swift Dictionaries with Examples"},"content":{"rendered":"<p>Dictionaries are one of the collection data types in Swift. They are unordered collections. It has key-value pairs in it. Each key is unique in a dictionary, but a key can have multiple values. It helps in efficient look-up. It maps two elements: key and value. The key and value can be of any data type.<\/p>\n<p>This article will discuss how to create, modify and access dictionaries in Swift. We\u2019ll also cover other concepts related to it, along with relevant examples.<\/p>\n<h2>Create Dictionary in Swift<\/h2>\n<p>We can create a dictionary by writing a var\/let followed by the dictionary&#8217;s name. We can also write the type of key and value in the type declaration.<\/p>\n<p><strong>Syntax for creating a dictionary.<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var exampleDictionary: [keyType: valueType] = [key1: value1, key2:  value2, ..., keyN: valueN]<\/pre>\n<p><strong>For example,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var dictionaryExample: [Int: String] = [ 2014: \"DataFlair\", 2023: \"Swift\"]\r\nprint(dictionaryExample)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>[2023: &#8220;Swift&#8221;, 2014: &#8220;DataFlair&#8221;]<\/p>\n<h3>Create an empty dictionary in Swift<\/h3>\n<p>We can create an empty dictionary in Swift. We do it by defining the data types of key and value.<\/p>\n<p><strong>Syntax for creating an empty dictionary.<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var dictionaryExample = [keyType: valueType]()<\/pre>\n<p><strong>Example given,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var dictionaryExample = [Int: String]()<\/pre>\n<h3>Modify Dictionary in Swift<\/h3>\n<p>We can modify the elements of a dictionary. We can add elements or remove elements from it. We can also edit the values of the elements.<\/p>\n<h4>Add elements<\/h4>\n<p>We add new elements to the dictionary by assigning values. We assign new values to a new key of the dictionary. This key is written within [] brackets while assigning the value.<\/p>\n<p><strong>Syntax for adding a new element<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var dictionaryExample[newKey] = newValue<\/pre>\n<p><strong>For example,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var dictionaryExample = [ 2014: \"DataFlair\", 2023: \"Swift\"]\r\nprint(\"Original: \\(dictionaryExample)\")\r\ndictionaryExample[2020] = \"Dictionary\"\r\nprint(\"Updated: \\(dictionaryExample)\")<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong>Original:<\/strong> [2023: &#8220;Swift&#8221;, 2014: &#8220;DataFlair&#8221;]<br \/>\n<strong>Updated:<\/strong> [2023: &#8220;Swift&#8221;, 2020: &#8220;Dictionary&#8221;, 2014: &#8220;DataFlair&#8221;]<\/p>\n<h4>Remove elements<\/h4>\n<p>We can also remove key-value pairs from the dictionary.<\/p>\n<p><strong>Syntax for removing elements from dictionaries.<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">someDictionary.removeValue(forKey: keyValue)<\/pre>\n<p><strong>Example given,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var dictionaryExample = [2023: \"Swift\", 2020: \"Dictionary\", 2014: \"DataFlair\"]\r\nprint(\"Original: \\(dictionaryExample)\")\r\ndictionaryExample.removeValue(forKey: 2020)\r\nprint(\"Updated: \\(dictionaryExample)\")<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong>Original:<\/strong> [2020: &#8220;Dictionary&#8221;, 2014: &#8220;DataFlair&#8221;, 2023: &#8220;Swift&#8221;]<br \/>\n<strong>Updated:<\/strong> [2014: &#8220;DataFlair&#8221;, 2023: &#8220;Swift&#8221;]<\/p>\n<h4>Change elements<\/h4>\n<p>We can change the values of elements in the dictionary by reassigning values to the particular key of the dictionary.<\/p>\n<p><strong>Syntax for changing the value.<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">dictionaryExample[key] = newValue<\/pre>\n<p><strong>For example,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var dictionaryExample = [2023: \"Swift\", 2020: \"Dictionary\", 2014: \"DataFlair\"]\r\nprint(\"Original: \\(dictionaryExample)\")\r\ndictionaryExample[2020] = \"Collections\"\r\nprint(\"Updated: \\(dictionaryExample)\")<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong>Original:<\/strong> [2014: &#8220;DataFlair&#8221;, 2020: &#8220;Dictionary&#8221;, 2023: &#8220;Swift&#8221;]<br \/>\n<strong>Updated:<\/strong> [2014: &#8220;DataFlair&#8221;, 2020: &#8220;Collections&#8221;, 2023: &#8220;Swift&#8221;]<\/p>\n<h3>Access elements of Dictionary<\/h3>\n<p>We can access the elements of a dictionary in Swift. We can do it either by using the key or the value property of the dictionary.<\/p>\n<h4>Access keys<\/h4>\n<p>To access keys, we use the keys property of a dictionary. <strong>For example,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var dictionaryExample = [2023: \"Swift\", 2020: \"Dictionary\", 2014: \"DataFlair\"]\r\nprint(\"Keys of the dictionary: \\(dictionaryExample.keys)\")<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong>Keys of the dictionary:<\/strong> [2020, 2023, 2014]<\/p>\n<h4>Access values<\/h4>\n<p>To access values, we use the values property of a dictionary.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var dictionaryExample = [2023: \"Swift\", 2020: \"Dictionary\", 2014: \"DataFlair\"]\r\nprint(\"Values of the dictionary: \\(dictionaryExample.values)\")<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong>Values of the dictionary:<\/strong> [&#8220;Dictionary&#8221;, &#8220;DataFlair&#8221;, &#8220;Swift&#8221;]<\/p>\n<h3>Swift Dictionary Properties and Methods<\/h3>\n<p>Swift provides a number of methods and properties to manipulate elements and use them at our convenience.<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Property\/Method\u00a0<\/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\">Gives the number of elements in a dictionary<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">isEmpty<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns true if the dictionary is empty<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">shuffled()<\/span><\/td>\n<td><span style=\"font-weight: 400\">Shuffles the order of elements in the dictionary<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">sorted()<\/span><\/td>\n<td><span style=\"font-weight: 400\">Sorts the element in the dictionary<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">contains()<\/span><\/td>\n<td><span style=\"font-weight: 400\">Check if the particular element is present in the dictionary or not<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">randomElement()<\/span><\/td>\n<td><span style=\"font-weight: 400\">Gives random elements of the dictionary<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">firstIndex()<\/span><\/td>\n<td><span style=\"font-weight: 400\">Gives index of the given element<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Filter in Dictionary<\/h3>\n<p>Swift offers a unique property which can filter values in a dictionary. <strong>For example,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var subjectMarks = [\"Maths\": 100, \"Physics\": 98, \"Chemistry\": 99, \"English\": 95, \"French\": 90]\r\nvar subjectWithAGrade = subjectMarks.filter{$0.value &gt; 95}\r\nprint(subjectWithAGrade)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>[&#8220;Maths&#8221;: 100, &#8220;Chemistry&#8221;: 99, &#8220;Physics&#8221;: 98]<\/p>\n<h3>Swift Grouping Dictionary<\/h3>\n<p>We can group dictionary values based on several conditions we provide. <strong>The below example groups the subjects based on their first letter.<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var subjectMarks = [\"Maths\": 100, \"Physics\": 98, \"Chemistry\": 99, \"English\": 95, \"Music\": 90, \"Psychology\": 94, \"Economics\": 92]\r\n\r\nvar groupedSubjects = Dictionary(grouping: subjectMarks.keys) {$0.first!}\r\nprint(groupedSubjects)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>[&#8220;P&#8221;: [&#8220;Physics&#8221;, &#8220;Psychology&#8221;], &#8220;M&#8221;: [&#8220;Maths&#8221;, &#8220;Music&#8221;], &#8220;C&#8221;: [&#8220;Chemistry&#8221;], &#8220;E&#8221;: [&#8220;Economics&#8221;, &#8220;English&#8221;]]<\/p>\n<h3>Swift Loop and dictionary<\/h3>\n<p>We can iterate through the elements of the dictionary using a for-in loop. <strong>Example given,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var dictionaryExample = [2023: \"Swift\", 2020: \"Dictionary\", 2014: \"DataFlair\"]\r\nfor (key, value) in dictionaryExample{\r\n    print(\"Key: \\(key), Value: \\(value)\")\r\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong>Key:<\/strong> 2023, Value: Swift<br \/>\n<strong>Key:<\/strong> 2014, Value: DataFlair<br \/>\n<strong>Key:<\/strong> 2020, Value: Dictionary<\/p>\n<h3>Arrays and Dictionaries in Swift<\/h3>\n<p>Swift provides methods to convert arrays into dictionaries and a dictionary into arrays.<\/p>\n<h4>Arrays to dictionary<\/h4>\n<p>To convert arrays into a dictionary, we need two arrays. One array will correspond to the keys in the dictionary and the second array will correspond to the values.<\/p>\n<p><strong>Syntax to convert an array into a dictionary.<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var newDictionary = Dictionary(uniqueKeysWithValues: zip(Array1, Array2)<\/pre>\n<p><strong>For example,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var keysArray = [2023, 2020, 2014]\r\nvar valuesArray = [\"Swift\", \"Dictionary\", \"DataFlair\"]\r\nvar dictionaryExample = Dictionary(uniqueKeysWithValues: zip(keysArray, valuesArray))\r\nprint(dictionaryExample)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>[2020: &#8220;Dictionary&#8221;, 2014: &#8220;DataFlair&#8221;, 2023: &#8220;Swift&#8221;]<\/p>\n<h4>Dictionary to arrays<\/h4>\n<p>We can convert a dictionary into 2 arrays. One array is made from the keys of the dictionary. Another array is made from the values of the array. <strong>For example,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var dictionaryExample = [2023: \"Swift\", 2020: \"Dictionary\", 2014: \"DataFlair\"]\r\nvar keysArray = dictionaryExample.keys\r\nvar valuesArray = dictionaryExample.values\r\nprint(\"Keys array: \\(keysArray)\")\r\nprint(\"Values array: \\(valuesArray)\")<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong>Keys array:<\/strong> [2023, 2020, 2014]<br \/>\n<strong>Values array:<\/strong> [&#8220;Swift&#8221;, &#8220;Dictionary&#8221;, &#8220;DataFlair&#8221;]<\/p>\n<h3>Conclusion<\/h3>\n<p>Swift dictionaries are a unique way to map data into keys and their values. It helps in handling data efficiently. In this article, we\u2019ve seen how to create and modify arrays. We\u2018ve gone through how we can access them and use them with loops. We have also covered how we can convert arrays into dictionaries and vice-versa.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dictionaries are one of the collection data types in Swift. They are unordered collections. It has key-value pairs in it. Each key is unique in a dictionary, but a key can have multiple values.&#46;&#46;&#46;<\/p>\n","protected":false},"author":581,"featured_media":120589,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27789],"tags":[28453,28451,29056,28452,28287],"class_list":["post-120587","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-swift-tutorials","tag-dictionary-in-swift","tag-swift-dictionaries","tag-swift-dictionaries-with-example","tag-swift-dictionary","tag-swift-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Swift Dictionaries with Examples - DataFlair<\/title>\n<meta name=\"description\" content=\"Swift dictionaries are a unique way to map data into keys and their values. It helps in handling data efficiently.\" \/>\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\/swift-dictionaries\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Swift Dictionaries with Examples - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Swift dictionaries are a unique way to map data into keys and their values. It helps in handling data efficiently.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/swift-dictionaries\/\" \/>\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-18T12:30:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-18T12:39:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/Swift-Dictionaries.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=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Swift Dictionaries with Examples - DataFlair","description":"Swift dictionaries are a unique way to map data into keys and their values. It helps in handling data efficiently.","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\/swift-dictionaries\/","og_locale":"en_US","og_type":"article","og_title":"Swift Dictionaries with Examples - DataFlair","og_description":"Swift dictionaries are a unique way to map data into keys and their values. It helps in handling data efficiently.","og_url":"https:\/\/data-flair.training\/blogs\/swift-dictionaries\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2023-11-18T12:30:26+00:00","article_modified_time":"2023-11-18T12:39:54+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/Swift-Dictionaries.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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/swift-dictionaries\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/swift-dictionaries\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445"},"headline":"Swift Dictionaries with Examples","datePublished":"2023-11-18T12:30:26+00:00","dateModified":"2023-11-18T12:39:54+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/swift-dictionaries\/"},"wordCount":715,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/swift-dictionaries\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/Swift-Dictionaries.webp","keywords":["dictionary in swift","swift dictionaries","swift dictionaries with example","swift dictionary","swift tutorials"],"articleSection":["Swift Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/swift-dictionaries\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/swift-dictionaries\/","url":"https:\/\/data-flair.training\/blogs\/swift-dictionaries\/","name":"Swift Dictionaries with Examples - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/swift-dictionaries\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/swift-dictionaries\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/Swift-Dictionaries.webp","datePublished":"2023-11-18T12:30:26+00:00","dateModified":"2023-11-18T12:39:54+00:00","description":"Swift dictionaries are a unique way to map data into keys and their values. It helps in handling data efficiently.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/swift-dictionaries\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/swift-dictionaries\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/swift-dictionaries\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/Swift-Dictionaries.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/Swift-Dictionaries.webp","width":1200,"height":628,"caption":"Swift Dictionaries"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/swift-dictionaries\/#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":"Swift Dictionaries with Examples"}]},{"@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\/120587","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=120587"}],"version-history":[{"count":4,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120587\/revisions"}],"predecessor-version":[{"id":126542,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120587\/revisions\/126542"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/120589"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=120587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=120587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=120587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}