{"id":19103,"date":"2020-12-29T21:14:31","date_gmt":"2020-12-30T05:14:31","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=19103"},"modified":"2023-12-01T04:06:27","modified_gmt":"2023-12-01T12:06:27","slug":"selection-sort-python","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/selection-sort-python\/","title":{"rendered":"Selection Sort Python: A Guide"},"content":{"rendered":"\n<p><em>A Python selection sort divides a list into two small lists. One list represents the sorted elements. The other list contains the unsorted elements. The selection sort finds the smallest or highest values in each iteration and moves those values to the ordered list.<\/em><\/p>\n\n\n\n<p>Sorting lists is a common operation in a range of programs.<\/p>\n\n\n\n<p>Consider this example: A teacher wants to learn more about how well their students did in their most recent test. A teacher may want to sort the students\u2019 scores in ascending and descending order. This will let them easily find out what the highest and lowest test scores were.<\/p>\n\n\n\n<p>Enter, the selection sort. The selection sort is an algorithm that you can use to sort a list in either ascending order or descending order.<\/p>\n\n\n\n<p>In this guide, we\u2019re going to discuss how to write a selection sort program in Python. We\u2019ll walk through an example throughout this guide so that you can learn the ins-and-outs of selection sorts.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is a Python Selection Sort?<\/h2>\n\n\n\n<p>A Python selection sort repeatedly finds the minimum element in a list and moves that element to a particular end of the list. The sort keeps going until the array is sorted in order. You can also instruct a selection sort to find the maximum element. Both approaches sort a list.<\/p>\n\n\n\n<p>Selection sorts assume that the first element in a list is the smallest value. The sort will then compare that value with the second element. If the second element is smaller than the minimum value, the second element becomes the minimum value.<\/p>\n\n\n\n<p>This process is repeated until the last element of the list is reached. Once this element is reached, the minimum value is placed at the start of the unsorted list.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python Selection Sort Guide<\/h2>\n\n\n\n<p>There\u2019s no better way to learn about selection sorts than to run through an example. Let\u2019s go through and sort a list of student grades in ascending order. Consider this unsorted list:<\/p>\n\n\n\n<table class=\"wp-block-table course-info-table\"><tbody><tr><td>73<\/td><td>62<\/td><td>61<\/td><td>69<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>We\u2019ll start by calling the first value of our list the <em>minimum<\/em>. Each iteration of the selection sort will find the smallest element and move it into the sorted subarray.<\/p>\n\n\n\n<p>Sorting the minimum element is one option. A selection sort works if you sort the maximum element. But, we&#8217;re using the minimum element in this example.<\/p>\n\n\n\n<p>Next, we\u2019ll compare the minimum value with the second element. If this element is smaller than minimum, the second element should become the minimum value.<\/p>\n\n\n\n<p>We are going to compare 73 and 62. 73 is greater than 62, which means that our new minimum value is 62. Our list will then go through all the other numbers in our list:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Is 61 greater than 62 (our minimum value)? No, so swap the numbers. Minimum becomes 61.<\/li><li>Is 69 greater than 61 (our minimum value)? Yes, so do nothing. Minimum stays at 61.<\/li><\/ul>\n\n\n\n<p>Our list looks the same:<\/p>\n\n\n\n<table class=\"wp-block-table course-info-table\"><tbody><tr><td>73<\/td><td>62<\/td><td>61<\/td><td>69<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>When you reach the end of the list, you can move minimum to the start of the list:<\/p>\n\n\n\n<table class=\"wp-block-table course-info-table\"><tbody><tr><td>61<\/td><td>73<\/td><td>62<\/td><td>69<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>61 (our minimum value) has been moved to the start of the list, and every other value has moved up by one. We\u2019ll repeat this process until all the elements are sorted.<\/p>\n\n\n\n<p>Each iteration of our list will return the following:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>73, 62, 61, 69<\/li><li>61, 73, 62, 69<\/li><li>61, 62, 73, 69<\/li><li>61, 62, 69, 73<\/li><\/ol>\n\n\n\n<p>When the selection sort has checked all the elements in the list, the sort will stop.<\/p>\n\n\n\n<p>The sorted subarray and the subarray which is unsorted are both invisible to us. Our algorithm sorts an array for us and keeps track of the unsorted part of the array.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Perform a Selection Sort in Python<\/h2>\n\n\n\n<p>You\u2019re now familiar with the theory: well done! It\u2019s time for the big challenge. We\u2019re going to implement the selection sort algorithm in Python. Let\u2019s write a program that takes in a <a href=\"https:\/\/careerkarma.com\/blog\/python-array\/\">Python array<\/a> and sorts it in ascending order.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Define a Sort Function<\/h3>\n\n\n\n<p>We\u2019ll start by defining a <a href=\"https:\/\/careerkarma.com\/blog\/python-functions\/\">Python function<\/a> that performs our selection sort:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>def sortList(array):\n\tlength = len(array)\n\n\tfor item in range(length):\n\t\tminimum = item\n\n\t\tfor i in range(item + 1, length):\n\t\t\tif array[i] &lt; array[minimum]:\n\t\t\t\tminimum = i\n\n\t\t(array[item], array[minimum]) = (array[minimum], array[item])<\/pre><\/div>\n\n\n\n<p>We\u2019ve started by using the <a href=\"https:\/\/careerkarma.com\/blog\/python-len\/\">Python len() method<\/a> to get the length of our list. We then use this to initiate a <a href=\"https:\/\/careerkarma.com\/blog\/python-for-loop\/\">Python <em>for<\/em> loop<\/a> which loops over every item in our list.<\/p>\n\n\n\n<p>For each iteration in the loop, we set the value of <em>minimum<\/em> to be the first item in our list. We did this in our walkthrough earlier. Once we\u2019ve set a minimum value, another <em>for<\/em> loop begins which runs through every item in our list.<\/p>\n\n\n\n<p>For each item in the list, our algorithm checks if the minimum value is larger than that item. If it is, nothing happens; otherwise, the minimum value becomes the item that the program is reading.<\/p>\n\n\n\n<p>Upon looping through every item in our list, our algorithm moves the minimum value to the start of the list. Then, our program will keep going until the top <em>for<\/em> loop terminates. This is because selection sorts run a number of times equal to the length of a list.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Call the Sorting Function<\/h3>\n\n\n\n<p>You may have noticed that if we run our program, nothing happens. This is because we have not yet told our code what values to use yet. Add the following code to the bottom of your program, outside the sortList function:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>numbers = [73, 62, 61, 69]\nsortList(numbers)\nprint(&quot;Sorted list:&quot;, numbers)\n<\/pre><\/div>\n\n\n\n<p>When we run our program, the following is returned:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>[61, 62, 69, 73]<\/pre><\/div>\n\n\n\n<p>Our list has been sorted. Pat yourself on the back; you did it!<\/p>\n\n\n\n<p>Selection sorts can be used to sort a list in descending order. If you want to sort a list in this way, you can change the \u201cif\u201d statement in the selection sort to the following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>if array[i] &gt; array[minimum]:<\/pre><\/div>\n\n\n\n<p>We\u2019ve changed the lesser than sign to a greater than sign. This will sort our list in descending order, because the minimum value will be set to the highest value in the list. Technically, our <em>minimum<\/em> value becomes a <em>maximum<\/em> value.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">When Should You Use a Selection Sort?<\/h2>\n\n\n\n<p>Selection sorts, like bubble sorts, are best used for smaller lists. This is because the algorithm isn\u2019t as efficient as others such as an insertion sort when used on larger lists.<\/p>\n\n\n\n<p>A selection sort is a great sort to learn when you\u2019re just starting with sorting algorithms. Other sorts can be difficult to master, but having a clear understanding of selection sorts can help you understand different types of lists.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is the Complexity for the Selection Sort?<\/h2>\n\n\n\n<p>The selection sort has a time complexity of O(n2). This means that the complexity of the algorithm will grow exponentially depending on how many elements are in the list.<\/p>\n\n\n\n<p>O(n2) is the worst-case, average, and best-case complexity for this algorithm. If you&#8217;d like to learn more about sorting complexities, check out our guide to <a href=\"https:\/\/careerkarma.com\/blog\/big-o-notation-time\/\">Big O Notation<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Selection sorts are an important method of sorting data. Selection sorts read through every item in a list and, on each iteration, move the smallest item to the start of the list. This happens until every item in the list has been read.<\/p>\n\n\n\n<p>Selection sorts are not widely used outside of teaching because there are more efficient algorithms to use. With that said, they are a good springboard into learning other sorts, such as an insertion or merge sort.<\/p>\n\n\n\n<p>Are you interested in learning more about Python? Read our complete <a href=\"https:\/\/careerkarma.com\/blog\/how-to-learn-python\/\">How to Learn Python guide<\/a> for expert advice to help you advance your knowledge.<\/p>\n","protected":false},"excerpt":{"rendered":"A Python selection sort divides a list into two small lists. One list represents the sorted elements. The other list contains the unsorted elements. The selection sort finds the smallest or highest values in each iteration and moves those values to the ordered list. Sorting lists is a common operation in a range of programs.&hellip;","protected":false},"author":240,"featured_media":19104,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[],"class_list":{"0":"post-19103","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"Python","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":null,"is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.0 (Yoast SEO v27.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Selection Sort Python: A Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"Selection sorts sort an array by finding the lowest value and moving it to the beginning of a list until the list is sorted. On Career Karma, learn how to write a selection sort in Python.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/selection-sort-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Selection Sort Python: A Guide\" \/>\n<meta property=\"og:description\" content=\"Selection sorts sort an array by finding the lowest value and moving it to the beginning of a list until the list is sorted. On Career Karma, learn how to write a selection sort in Python.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/selection-sort-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-30T05:14:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T12:06:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/notebook-1226398.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"563\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Gallagher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Gallagher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/selection-sort-python\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/selection-sort-python\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Selection Sort Python: A Guide\",\"datePublished\":\"2020-12-30T05:14:31+00:00\",\"dateModified\":\"2023-12-01T12:06:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/selection-sort-python\/\"},\"wordCount\":1217,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/selection-sort-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/notebook-1226398.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/selection-sort-python\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/selection-sort-python\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/selection-sort-python\/\",\"name\":\"Selection Sort Python: A Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/selection-sort-python\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/selection-sort-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/notebook-1226398.jpg\",\"datePublished\":\"2020-12-30T05:14:31+00:00\",\"dateModified\":\"2023-12-01T12:06:27+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"Selection sorts sort an array by finding the lowest value and moving it to the beginning of a list until the list is sorted. On Career Karma, learn how to write a selection sort in Python.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/selection-sort-python\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/selection-sort-python\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/selection-sort-python\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/notebook-1226398.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/notebook-1226398.jpg\",\"width\":1000,\"height\":563},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/selection-sort-python\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/careerkarma.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\",\"item\":\"https:\/\/careerkarma.com\/blog\/python\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Selection Sort Python: A Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\",\"url\":\"https:\/\/careerkarma.com\/blog\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/careerkarma.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\",\"name\":\"James Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"caption\":\"James Gallagher\"},\"description\":\"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.\",\"url\":\"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Selection Sort Python: A Guide | Career Karma","description":"Selection sorts sort an array by finding the lowest value and moving it to the beginning of a list until the list is sorted. On Career Karma, learn how to write a selection sort in Python.","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:\/\/careerkarma.com\/blog\/selection-sort-python\/","og_locale":"en_US","og_type":"article","og_title":"Selection Sort Python: A Guide","og_description":"Selection sorts sort an array by finding the lowest value and moving it to the beginning of a list until the list is sorted. On Career Karma, learn how to write a selection sort in Python.","og_url":"https:\/\/careerkarma.com\/blog\/selection-sort-python\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-12-30T05:14:31+00:00","article_modified_time":"2023-12-01T12:06:27+00:00","og_image":[{"width":1000,"height":563,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/notebook-1226398.jpg","type":"image\/jpeg"}],"author":"James Gallagher","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"James Gallagher","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/selection-sort-python\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/selection-sort-python\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Selection Sort Python: A Guide","datePublished":"2020-12-30T05:14:31+00:00","dateModified":"2023-12-01T12:06:27+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/selection-sort-python\/"},"wordCount":1217,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/selection-sort-python\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/notebook-1226398.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/selection-sort-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/selection-sort-python\/","url":"https:\/\/careerkarma.com\/blog\/selection-sort-python\/","name":"Selection Sort Python: A Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/selection-sort-python\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/selection-sort-python\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/notebook-1226398.jpg","datePublished":"2020-12-30T05:14:31+00:00","dateModified":"2023-12-01T12:06:27+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"Selection sorts sort an array by finding the lowest value and moving it to the beginning of a list until the list is sorted. On Career Karma, learn how to write a selection sort in Python.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/selection-sort-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/selection-sort-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/selection-sort-python\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/notebook-1226398.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/notebook-1226398.jpg","width":1000,"height":563},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/selection-sort-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Python","item":"https:\/\/careerkarma.com\/blog\/python\/"},{"@type":"ListItem","position":3,"name":"Selection Sort Python: A Guide"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94","name":"James Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","caption":"James Gallagher"},"description":"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.","url":"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/19103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/240"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=19103"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/19103\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/19104"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=19103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=19103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=19103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}