

{"id":120280,"date":"2023-11-07T18:00:28","date_gmt":"2023-11-07T12:30:28","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=120280"},"modified":"2023-11-07T18:29:21","modified_gmt":"2023-11-07T12:59:21","slug":"swift-loops","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/swift-loops\/","title":{"rendered":"Swift Loops"},"content":{"rendered":"<p>Loops are important in programming. It helps us iterate through items and collections. It runs the same or similar code until the condition becomes false. It automates tasks. It solves complex problems. In this article, we\u2019ll talk about swift loops, their different types, their usage and several other concepts related to them. We\u2019ll also go through relevant examples to understand these better.<\/p>\n<h2>Types of Swift Loops<\/h2>\n<p>Swift provides three types of loops: for-in loop, while loop, and repeat-while loop. Each type helps us in different scenarios.<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Type of Loop<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">for-in<\/span><\/td>\n<td><span style=\"font-weight: 400\">Performs iterations in the given range or collection<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">while\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400\">Check for the condition first and iterate until the condition is false.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">repeat-while<\/span><\/td>\n<td><span style=\"font-weight: 400\">Check for a condition at last and iterate until the condition is false.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>for-in loop in Swift<\/h3>\n<p>The for-in loop iterates a fixed number of times. It executes a block for the given amount of times.<\/p>\n<p><strong>Syntax for for in loop.<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">for item in collection{\r\n    \/\/code expressions\r\n}<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/for-in-loop.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-120876 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/for-in-loop.webp\" alt=\"for in loop\" width=\"600\" height=\"400\" \/><\/a><\/p>\n<p>We can use for-in loop loop to iterate through particular data structures like arrays or dictionaries. We can also use them with a where clause or a stride function. These are explained in detail below.<\/p>\n<h4>for-in loop in an array<\/h4>\n<p>We iterate through an array using a for-in loop. It helps us access a particular element in the array. We can also<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var names = [\"DataFlair\", \"Swift\", \"Loops\"]\r\n\r\nfor name in names{\r\n    print(name)\r\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>DataFlair<br \/>\nSwift<br \/>\nLoops<\/p>\n<h4>for-in loop in a dictionary<\/h4>\n<p>We iterate through a dictionary using a for-in loop. We can access both keys and values using this.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var dictionaryExample = [1:\"DataFlair\", 2:\"Swift\", 3:\"Loops\"]\r\n\r\nprint(\"Keys:\")\r\nfor key in dictionaryExample.keys{\r\n    print(key)\r\n}\r\nprint(\"\\nValues:\")\r\nfor value in dictionaryExample.values{\r\n    print(value)\r\n}\r\nprint(\"\\nKeys and Values:\")\r\nfor (key, value) in dictionaryExample{\r\n    print(key,value)\r\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong>Keys:<\/strong><br \/>\n1<br \/>\n2<br \/>\n3<\/p>\n<p><strong>Values:<\/strong><br \/>\nDataFlair<br \/>\nSwift<br \/>\nLoops<\/p>\n<p><strong>Keys and Values:<\/strong><br \/>\n1 DataFlair<br \/>\n2 Swift<br \/>\n3 Loops<\/p>\n<h4>for-in loop in a range<\/h4>\n<p>We can iterate through a range of values using a for-in loop.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">for index in 17...67{\r\n    if (index%7 == 0){\r\n        print(index)\r\n    }\r\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>21<br \/>\n28<br \/>\n35<br \/>\n42<br \/>\n49<br \/>\n56<br \/>\n63<\/p>\n<h4>for-in loop with where clause<\/h4>\n<p>We can filter the values while iterating through a loop using the where clause. If it is a true condition, then the loop is executed.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var names = [\"DataFlair\", \"Swift\", \"Loops\", \"Control Flow\"]\r\n\r\nfor name in names where name != \"Swift\"{\r\n    print(name)\r\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>DataFlair<br \/>\nLoops<br \/>\nControl Flow<\/p>\n<h4>for-in loop with stride function<\/h4>\n<p>If we want to iterate through a range but we want to increment it by fixed values, we use a stride function instead of a range. It increases by a fixed value in a given set of numbers.<\/p>\n<p><strong>Syntax of stride function<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">stride(from: val1, to: val2, by: val3)<\/pre>\n<p>The range starts with val1 and ends at val2. It is incremented by val3 in the given range after every iteration.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">for index in stride(from: 23, to: 45, by: 5){\r\n    print(index)\r\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>23<br \/>\n28<br \/>\n33<br \/>\n38<br \/>\n43<\/p>\n<h3>while loop in Swift<\/h3>\n<p>In a while loop, we execute the iterations until the given condition fails. In this type of loop, We cannot keep track of the number of iterations.<\/p>\n<p><strong>Syntax of while loop.<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">while (condition){\r\n    \/\/code expressions\r\n}<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/while-loop.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-120877 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/while-loop.webp\" alt=\"while loop\" width=\"600\" height=\"400\" \/><\/a><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var countdown = 4\r\n\r\nwhile countdown &gt; 0{\r\n    print(countdown)\r\n    countdown -= 1\r\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>4<br \/>\n3<br \/>\n2<br \/>\n1<\/p>\n<h4>Infinite Loop in Swift<\/h4>\n<p>Note that we need to provide an expression within the while loop so that the condition fails at some point. If the condition remains true for all the cases, then the loop might go into an infinite loop. This might lead to crashing, or the program may become unresponsive.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var countdown = 4\r\n\r\nwhile countdown == 4{\r\n    print(countdown)\r\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>It prints 4 until the whole memory block is used or the program crashes.<\/p>\n<h4>repeat-while loop<\/h4>\n<p>Repeat-while loop is a while loop, but in this, it ensures that at least the block of code within it is executed once. It then goes on until the condition becomes false. In other programming languages, it is also known as do-while loop.<\/p>\n<p><strong>Syntax of repeat-while loop.<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">repeat{\r\n    \/\/code expression\r\n}while (condition)<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/repeat-while-loop.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-120878 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/repeat-while-loop.webp\" alt=\"repeat while loop\" width=\"600\" height=\"400\" \/><\/a><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var countdown = 4\r\nrepeat{\r\n    print(countdown)\r\n    countdown -= 1\r\n}while(countdown &gt; 0)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>4<br \/>\n3<br \/>\n2<br \/>\n1<\/p>\n<h4>Infinite Loop in Swift<\/h4>\n<p>Note that we need to provide an expression within the while loop so that condition fails at some point. If the condition remains true for all the cases, then the loop might go into an infinite loop. This might lead to crashing, or the program may become unresponsive.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var countdown = 4\r\nrepeat{\r\n    print(countdown)\r\n}while(countdown &gt; 0)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>It prints 4 until the whole memory block is used or the program crashes.<\/p>\n<h3>Nested Loops in Swift<\/h3>\n<p>Nested loops are loops inside another loop. Each iteration in the outer loop enables multiple iterations in the inner loop. Nested looping helps us in working with multidimensional structures.<\/p>\n<p><strong>Syntax of nested loops.<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">for outerLoopIndex in OuterLoop{\r\n    For innerLoopIndex in InnerLoop{\r\n        \\\\code expressions\r\n    }\r\n}<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">for outerIndex in 31...100{\r\n    for innerIndex in 25...30{\r\n        if (outerIndex%innerIndex == 0){\r\n            print(innerIndex, outerIndex)\r\n        }\r\n    }\r\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>25 50<br \/>\n26 52<br \/>\n27 54<br \/>\n28 56<br \/>\n29 58<br \/>\n30 60<br \/>\n25 75<br \/>\n26 78<br \/>\n27 81<br \/>\n28 84<br \/>\n29 87<br \/>\n30 90<br \/>\n25 100<\/p>\n<h3>Control Flow Statements in Swift Loops<\/h3>\n<p>Control flow statements in Swift control the flow and execution of the loops. There are two control flow statements used in Swift to manage the loop execution. The two control statements break and continue. These are discussed below with the help of examples.<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Type of Loop<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">continue<\/span><\/td>\n<td><span style=\"font-weight: 400\">Stops the loop for the current iteration and goes to the next iteration.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">break<\/span><\/td>\n<td><span style=\"font-weight: 400\">Exits out of the loop.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>break<\/h4>\n<p>The break statement exits out of the loop. It doesn&#8217;t matter if the condition is met or not. It helps in reducing the unnecessary computations.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var isPrime = true\r\nfor number in 2...15{\r\n    for i in 2..&lt;number{\r\n        \r\n        if number%i == 0{\r\n            isPrime = false\r\n            print(number)\r\n            break\r\n        }\r\n    }\r\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>4<br \/>\n6<br \/>\n8<br \/>\n9<br \/>\n10<br \/>\n12<br \/>\n14<br \/>\n15<\/p>\n<h4>continue<\/h4>\n<p>The continue statement skips the particular iteration and proceeds to the next one. This helps to optimize our program when we want to skip certain iterations.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">print(\"Even numbers\")\r\nfor number in 2...10{\r\n    if number%2 != 0{\r\n        continue\r\n    }\r\n    print(number)\r\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>Even numbers<br \/>\n2<br \/>\n4<br \/>\n6<br \/>\n8<br \/>\n10<\/p>\n<h3>Conclusion<\/h3>\n<p>We use loops to traverse through objects and collections. While loops in Swift execute a block of code for the specified number of times, repeat-while loops make sure the block of code is executed at least once. For-in loops iterate for a defined number of times. We use nested loops for using loops within another loop. To control the flow of our programs, Swift also provides us with break and continue statements.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Loops are important in programming. It helps us iterate through items and collections. It runs the same or similar code until the condition becomes false. It automates tasks. It solves complex problems. In this&#46;&#46;&#46;<\/p>\n","protected":false},"author":581,"featured_media":120282,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27789],"tags":[28417,28416,28418,28415,19209],"class_list":["post-120280","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-swift-tutorials","tag-for-in-loop","tag-loops-in-swift","tag-repeat-while-loop","tag-swift-loops","tag-while-loop"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Swift Loops - DataFlair<\/title>\n<meta name=\"description\" content=\"Loops are important in programming. In this article, we&#039;ll learn their different types of Swift Loops, their usage and several other concepts related to them.\" \/>\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-loops\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Swift Loops - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Loops are important in programming. In this article, we&#039;ll learn their different types of Swift Loops, their usage and several other concepts related to them.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/swift-loops\/\" \/>\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-07T12:30:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-07T12:59:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-loops.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":"Swift Loops - DataFlair","description":"Loops are important in programming. In this article, we'll learn their different types of Swift Loops, their usage and several other concepts related to them.","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-loops\/","og_locale":"en_US","og_type":"article","og_title":"Swift Loops - DataFlair","og_description":"Loops are important in programming. In this article, we'll learn their different types of Swift Loops, their usage and several other concepts related to them.","og_url":"https:\/\/data-flair.training\/blogs\/swift-loops\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2023-11-07T12:30:28+00:00","article_modified_time":"2023-11-07T12:59:21+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-loops.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\/swift-loops\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/swift-loops\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445"},"headline":"Swift Loops","datePublished":"2023-11-07T12:30:28+00:00","dateModified":"2023-11-07T12:59:21+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/swift-loops\/"},"wordCount":843,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/swift-loops\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-loops.webp","keywords":["for in loop","loops in swift","repeat while loop","swift loops","While loop"],"articleSection":["Swift Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/swift-loops\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/swift-loops\/","url":"https:\/\/data-flair.training\/blogs\/swift-loops\/","name":"Swift Loops - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/swift-loops\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/swift-loops\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-loops.webp","datePublished":"2023-11-07T12:30:28+00:00","dateModified":"2023-11-07T12:59:21+00:00","description":"Loops are important in programming. In this article, we'll learn their different types of Swift Loops, their usage and several other concepts related to them.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/swift-loops\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/swift-loops\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/swift-loops\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-loops.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-loops.webp","width":1200,"height":628,"caption":"swift loops"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/swift-loops\/#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 Loops"}]},{"@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\/120280","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=120280"}],"version-history":[{"count":4,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120280\/revisions"}],"predecessor-version":[{"id":124790,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120280\/revisions\/124790"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/120282"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=120280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=120280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=120280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}