{"id":15997,"date":"2020-05-15T00:31:01","date_gmt":"2020-05-15T07:31:01","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=15997"},"modified":"2023-12-01T02:45:45","modified_gmt":"2023-12-01T10:45:45","slug":"python-stack","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/python-stack\/","title":{"rendered":"Python Stack: A How-to Guide"},"content":{"rendered":"\n<p>Stacks are an important data structure with a wide range of uses.<br><\/p>\n\n\n\n<p>In programming, stacks allow you to store data in a last-in, first-out (LIFO) order. This means that the last item stored in a stack is the first one that will be processed.<br><\/p>\n\n\n\n<p>But how do you create a stack in Python? That\u2019s the question we are going to answer in this guide. By the end of reading this guide, you\u2019ll be an expert at creating and working with stacks in Python.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python Stacks<\/h2>\n\n\n\n<p>Stacks store data in a last-in, first-out (LIFO) order.<br><\/p>\n\n\n\n<p>To help you understand how this order works, consider a stack of plates. When you have a stack of plates to clean, the first plate you\u2019ll move is the one on the top. Then, as you move plates, you\u2019ll be able to access the ones lower down in the stack.<br><\/p>\n\n\n\n<p>Stacks are the opposite of queues in Python. Queues remove the least recently added item (because they use the first-in, first-out structure), whereas stacks remove the most recently added item (because they use the last-in, first-out structure).<br><\/p>\n\n\n\n<p>Stacks typically support two operations: push and pop. Pushing allows you to add an item to the top of a stack, and popping allows you to remove the item at the top of the stack.<br><\/p>\n\n\n\n<p>In Python, there are two main approaches you can use to create a stack: using built-in lists, and using the <code>collections.deque()<\/code> class. Let\u2019s break down how each of these approaches work.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python Built-In Lists<\/h2>\n\n\n\n<p>The built-in list data type allows you to create a stack in Python.<br><\/p>\n\n\n\n<p>Because Python lists are implemented as arrays, you can add and remove items to them easily. In addition, the order in which you insert values in a list will be preserved, which means that you can easily remove the first and last items in a list.<br><\/p>\n\n\n\n<p>Suppose we want to create a stack that stores a list of homework assignments in a class. The teacher wants to grade these assignments in the order they appear in the pile (so, the assignment handed in first will be at the bottom of the stack, and the assignment handed in last will be at the top of the stack).<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Add Items to Stack<\/h3>\n\n\n\n<p>To add items to a stack, we can use the <code>append()<\/code> method. We could create our homework assignment stack using the following code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>assignments = []\nassignments.append(\"Hannah\")\nassignments.append(\"Benny\")\nassignments.append(\"Gordon\")\nprint(assignments)<\/pre><\/div>\n\n\n\n<p>Our code returns:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>['Hannah','Benny','Gordon']<\/pre><\/div>\n\n\n\n<p>In our code, we first declare a list called <code>assignments<\/code>. Then, we use the <code>append()<\/code> method to add three names to our list of assignments that have been handed in. The names we add are, in order: Hannah, Benny, Gordon. Because Gordon handed in his assignment last, it appears in the final position in our list.<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Remove Items from Stack<\/h3>\n\n\n\n<p>Suppose that we have graded Gordon\u2019s assignment, and we want to find out which one is next to grade. This involves removing the item at the top of our stack.<br><\/p>\n\n\n\n<p>To remove an item from our stack, we can use the <code>pop()<\/code> method. Here\u2019s the code we could use to remove the top item on our stack:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>assignments = []\nassignments.append(\"Hannah\")\nassignments.append(\"Benny\")\nassignments.append(\"Gordon\")\nassignments.pop()\nprint(assignments)<\/pre><\/div>\n\n\n\n<p>Our code returns:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>['Hannah','Benny']<\/pre><\/div>\n\n\n\n<p>Gordon\u2019s name has been removed from the stack using <code>pop()<\/code>, and so our stack now only contains two names: Hannah and Benny.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">collections.deque Class<\/h2>\n\n\n\n<p>The deque class in the collections library allows you to create a double-ended queue.<br><\/p>\n\n\n\n<p>The deque object is implemented as a doubly-linked list, which means that it has strong and consistent performance when inserting and deleting elements. In addition, because the collections library is part of the Python Standard Library, you can import it into your code without having to download an external library.<br><\/p>\n\n\n\n<p>To work with the <code>collections.deque<\/code> class, we must first import it into our code using an import statement:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>from collections import deque<\/pre><\/div>\n\n\n\n<p>Let\u2019s return to our homework example from earlier to illustrate how the collections.deque class works.<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Add Items to a Deque Stack<\/h3>\n\n\n\n<p>To add items to a deque stack, we can use the <code>append()<\/code> method. Suppose we want to create a queue with our homework assignments using the deque class. We could do so using this code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>from collections import deque\nassignments = deque()\nassignments.append(\"Hannah\")\nassignments.append(\"Benny\")\nassignments.append(\"Gordon\")\nprint(assignments)<\/pre><\/div>\n\n\n\n<p>Our code returns:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>deque(['Hannah','Benny','Gordon'])<\/pre><\/div>\n\n\n\n<p>Let\u2019s break down our code. First, we import the deque class from the collections library. Then, we create a deque using <code>deque()<\/code> and assign it to the variable <code>assignments<\/code>.<br><\/p>\n\n\n\n<p>Next, we add three names to our assignments deque: Hannah, Benny, and Gordon. Finally, we print out the contents of our assignments queue to the console.<br><\/p>\n\n\n\n<p>You can see that, in this example, our data is stored as a deque instead of a stack (denoted by the fact our result is enclosed in <code>deque()<\/code>). This is because we are using the deque structure, even though our data still acts like a stack.<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Remove Items from a Deque Stack<\/h3>\n\n\n\n<p>To remove items from a deque stack, you can use the <code>pop()<\/code> method.<br><\/p>\n\n\n\n<p>Suppose we have just graded Gordon and Benny\u2019s assignments. To remove them from our stack, we could use the following code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>from collections import deque\nassignments = deque()\nassignments.append(\"Hannah\")\nassignments.append(\"Benny\")\nassignments.append(\"Gordon\")\nassignments.pop()\nassignments.pop()\nprint(assignments)<\/pre><\/div>\n\n\n\n<p>Our code returns:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>deque(['Hannah'])<\/pre><\/div>\n\n\n\n<p>In our code, we first create a deque stack with three values. Then, we execute the <code>pop()<\/code> statement twice. Each time the <code>pop()<\/code> statement runs, the item at the top of our stack is removed. This means that the values Gordon and then Benny are removed from our stack, leaving Hannah as the only item left in our stack.<br><\/p>\n\n\n\n<p>To learn more about the Python deque class, read our tutorial on <a href=\"https:\/\/careerkarma.com\/blog\/python-deque-queue\/\">Python queues and deques<\/a>.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Stacks allow you to store data in a last-in, first-out order. There are a number of ways to implement a stack in Python, but the two most practical approaches are to use the Python built-in list structure, or to use the <code>collections.deque()<\/code> class.<br><\/p>\n\n\n\n<p>This tutorial discussed, with reference to examples, how to create a stack in Python using lists and <code>collections.deque()<\/code>. Now you\u2019re ready to start creating your own stacks like a professional Python developer!<br><\/p>\n","protected":false},"excerpt":{"rendered":"Stacks are an important data structure with a wide range of uses. In programming, stacks allow you to store data in a last-in, first-out (LIFO) order. This means that the last item stored in a stack is the first one that will be processed. But how do you create a stack in Python? That\u2019s the&hellip;","protected":false},"author":240,"featured_media":15998,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[],"class_list":{"0":"post-15997","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":"","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>Python Stack: A How-to Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"A stack is a data structure that uses the last-in, first-out (LIFO) structure to store items. On Career Karma, learn two approaches to create a Python stack.\" \/>\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\/python-stack\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Stack: A How-to Guide\" \/>\n<meta property=\"og:description\" content=\"A stack is a data structure that uses the last-in, first-out (LIFO) structure to store items. On Career Karma, learn two approaches to create a Python stack.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/python-stack\/\" \/>\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-05-15T07:31:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T10:45:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/silver-laptop-computer-next-to-ceramic-cup-42408.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"680\" \/>\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=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-stack\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-stack\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Python Stack: A How-to Guide\",\"datePublished\":\"2020-05-15T07:31:01+00:00\",\"dateModified\":\"2023-12-01T10:45:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-stack\/\"},\"wordCount\":982,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-stack\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/silver-laptop-computer-next-to-ceramic-cup-42408.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-stack\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-stack\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/python-stack\/\",\"name\":\"Python Stack: A How-to Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-stack\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-stack\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/silver-laptop-computer-next-to-ceramic-cup-42408.jpg\",\"datePublished\":\"2020-05-15T07:31:01+00:00\",\"dateModified\":\"2023-12-01T10:45:45+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"A stack is a data structure that uses the last-in, first-out (LIFO) structure to store items. On Career Karma, learn two approaches to create a Python stack.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-stack\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-stack\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-stack\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/silver-laptop-computer-next-to-ceramic-cup-42408.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/silver-laptop-computer-next-to-ceramic-cup-42408.jpg\",\"width\":1020,\"height\":680},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-stack\/#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\":\"Python Stack: A How-to 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":"Python Stack: A How-to Guide | Career Karma","description":"A stack is a data structure that uses the last-in, first-out (LIFO) structure to store items. On Career Karma, learn two approaches to create a Python stack.","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\/python-stack\/","og_locale":"en_US","og_type":"article","og_title":"Python Stack: A How-to Guide","og_description":"A stack is a data structure that uses the last-in, first-out (LIFO) structure to store items. On Career Karma, learn two approaches to create a Python stack.","og_url":"https:\/\/careerkarma.com\/blog\/python-stack\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-05-15T07:31:01+00:00","article_modified_time":"2023-12-01T10:45:45+00:00","og_image":[{"width":1020,"height":680,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/silver-laptop-computer-next-to-ceramic-cup-42408.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":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/python-stack\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/python-stack\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Python Stack: A How-to Guide","datePublished":"2020-05-15T07:31:01+00:00","dateModified":"2023-12-01T10:45:45+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-stack\/"},"wordCount":982,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-stack\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/silver-laptop-computer-next-to-ceramic-cup-42408.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/python-stack\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/python-stack\/","url":"https:\/\/careerkarma.com\/blog\/python-stack\/","name":"Python Stack: A How-to Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-stack\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-stack\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/silver-laptop-computer-next-to-ceramic-cup-42408.jpg","datePublished":"2020-05-15T07:31:01+00:00","dateModified":"2023-12-01T10:45:45+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"A stack is a data structure that uses the last-in, first-out (LIFO) structure to store items. On Career Karma, learn two approaches to create a Python stack.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/python-stack\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/python-stack\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/python-stack\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/silver-laptop-computer-next-to-ceramic-cup-42408.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/silver-laptop-computer-next-to-ceramic-cup-42408.jpg","width":1020,"height":680},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/python-stack\/#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":"Python Stack: A How-to 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\/15997","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=15997"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/15997\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/15998"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=15997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=15997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=15997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}