{"id":21518,"date":"2021-01-14T04:10:27","date_gmt":"2021-01-14T12:10:27","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=21518"},"modified":"2023-12-01T04:08:06","modified_gmt":"2023-12-01T12:08:06","slug":"python-replace-item-in-list","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/","title":{"rendered":"Replace Item in List in Python: A Complete Guide"},"content":{"rendered":"\n<p><em>There are three ways to replace an item in a Python list. You can use list indexing or a for loop to replace an item. If you want to create a new list based on an existing list and make a change, you can use a list comprehension.<\/em><\/p>\n\n\n\n<p>You may decide that you want to change a value in a list. Suppose you&#8217;re building a menu for a restaurant. You may notice that you have misspelled one of the menu items. To fix this mistake, you will need to change an existing element in the list.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python Replace Item in List<\/h2>\n\n\n\n<p>You can replace an item in a Python list using a for loop, list indexing, or a list comprehension. The first two methods modify an existing list whereas a list comprehension creates a new list with the specified changes.<\/p>\n\n\n\n<p>Let&#8217;s summarize each method:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>List indexing: We use the index number of a list item to modify the value associated with that item. The equals sign is used to change a value in a list.<\/li><li>List comprehension: The list comprehension syntax creates a new list from an existing one. You can specify conditions in your list comprehension to determine the values in the new list.<\/li><li>For Loop: The loop iterates over the items in a list. You use indexing to make the actual change to the list. We use the enumerate() method to create two lists of index numbers and values over which we can iterate.<\/li><\/ul>\n\n\n\n<p>In this guide, we walk through each of these methods. We&#8217;ll refer to an example of each to help you get started.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python Replace Item in List: Using List Indexing<\/h2>\n\n\n\n<p>The easiest way to replace an item in a list is to use the <a href=\"https:\/\/careerkarma.com\/blog\/python-index\/\">Python indexing syntax<\/a>. Indexing allows you to choose an element or range of elements in a list. With the assignment operator, you can change a value at a given position in a list.\n\n<\/p>\n\n\n\n<p>We&#8217;re building a program that stores information on prices at a clothing store. The price of the first item in our list should be increased by $5. To do this, we use list indexing.\n\n<\/p>\n\n\n\n<p>Let\u2019s start by creating a list which contains our product prices:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>prices = [99.95, 72.50, 30.00, 29.95, 55.00]<\/pre><\/div>\n\n\n\n<p>We use indexing to select and change the first item in our list, <em>99.95<\/em>. This value has the index position zero. This is because lists are indexed starting from zero:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>prices[0] = 104.95\nprint(prices)<\/pre><\/div>\n\n\n\n<p>Our code selects the item at position zero and sets its value to <em>104.95<\/em>. This is a $5 increase on the old value. Our code returns our list of items with the first price changed:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>[104.95, 72.5, 30.0, 29.95, 55.0]<\/pre><\/div>\n\n\n\n<p>We can change our list by adding five to the current value of prices[0]:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>prices[0] = prices[0] + 5\nprint(prices)<\/pre><\/div>\n\n\n\n<p>prices[0] corresponds with the first item in our list (the one at index position <em>0<\/em>).<\/p>\n\n\n\n<p>Our code returns a list with the same values as our first example:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>[104.95, 72.5, 30.0, 29.95, 55.0]<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Python Replace Item in List: Using a List Comprehension<\/h2>\n\n\n\n<p>A <a href=\"https:\/\/careerkarma.com\/blog\/python-list-comprehension\/\">Python list comprehension<\/a> may be the most Pythonic way of finding and replacing an item in a list. This method is useful if you want to create a new list based on the values of an existing one.<\/p>\n\n\n\n<p>Using a list comprehension lets you iterate through items in an existing list and create a new list based on a certain criterion. You can generate a new list that only contains items beginning with \u201cC\u201d from an existing list, for instance.<\/p>\n\n\n\n<p>Here, we build a program that calculates a 10% discount on all the products in a clothing store that are worth more than $50. We use our list of product prices from earlier:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>prices = [99.95, 72.50, 30.00, 29.95, 55.00]<\/pre><\/div>\n\n\n\n<p>Next, we define a list comprehension to replace the items in our list:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>new_prices = [round(price - (price * 10 \/ 100), 2) if price &gt; 50 else price for price in prices]\nprint(new_prices)<\/pre><\/div>\n\n\n\n<p>This list comprehension iterates through the \u201cprices\u201d list and searches for values worth more than $50. A discount of 10% is applied to those items. We round the discounted values to two decimal places using the <em>round()<\/em> method.<\/p>\n\n\n\n<p>Our code returns our list of new prices:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>[89.95, 65.25, 30.0, 29.95, 49.5]<\/pre><\/div>\n\n\n\n<p>A 10% discount has been successfully applied to every item.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python Replace Item in List: Using a For Loop<\/h2>\n\n\n\n<p>You can replace items in a list using a <a href=\"https:\/\/careerkarma.com\/blog\/python-for-loop\/\">Python for loop<\/a>. To do so, we need to the <a href=\"https:\/\/careerkarma.com\/blog\/python-enumerate\/\">Python enumerate() function<\/a>. This function returns two lists: the index numbers in a list and the values in a list. We iterate over these two lists with a single for loop.<\/p>\n\n\n\n<p>In this example, we&#8217;re going to use the same list of prices in our code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>prices = [99.95, 72.50, 30.00, 29.95, 55.00]<\/pre><\/div>\n\n\n\n<p>We then define a for loop that iterates over this list with the <em>enumerate()<\/em> function:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>for index, item in enumerate(prices):\n\tif item &gt; 50:\n\t\tprices[index] = round(prices[index] - (prices[index] * 10 \/ 100), 2)\n\nprint(prices)<\/pre><\/div>\n\n\n\n<p>The value \u201cindex\u201d stores the index position of an item. \u201cItem\u201d is the value that correlates with that index position. The comma separates the two list values returned by the enumerate() method.<\/p>\n\n\n\n<p>Retrieving two or more values from a method or another value is called unpacking. We have &#8220;unpacked&#8221; two lists from the enumerate() method.<\/p>\n\n\n\n<p>We use the same formula from earlier to calculate a 10% discount on items worth over $50. Let\u2019s run our code and see what happens:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>[89.95, 65.25, 30.0, 29.95, 49.5]<\/pre><\/div>\n\n\n\n<p>Our code successfully changes the items in our \u201cprices\u201d list based on our discount.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>You can replace items in a Python list using list indexing, a list comprehension, or a for loop.<\/p>\n\n\n\n<p>If you want to replace one value in a list, the indexing syntax is most appropriate. To replace multiple items in a list that meet a criterion, using a list comprehension is a good solution. While for loops are functional, they are less Pythonic than list comprehensions.<\/p>\n\n\n\n<p>Are you interested in more resources to help you learn Python? If so, you should check out our <a href=\"https:\/\/careerkarma.com\/blog\/how-to-learn-python\/\">How to Learn Python guide<\/a>. This guide contains a list of top courses, books, and learning resources that will help you master the language.<\/p>\n","protected":false},"excerpt":{"rendered":"There are three ways to replace an item in a Python list. You can use list indexing or a for loop to replace an item. If you want to create a new list based on an existing list and make a change, you can use a list comprehension. You may decide that you want to&hellip;","protected":false},"author":240,"featured_media":21519,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[],"class_list":{"0":"post-21518","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>Replace Item in List in Python: A Complete Guide: A Complete Guide<\/title>\n<meta name=\"description\" content=\"On Career Karma, learn about how to replace items in a list using indexing, list comprehensions, and a for loop.\" \/>\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-replace-item-in-list\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Replace Item in List in Python: A Complete Guide\" \/>\n<meta property=\"og:description\" content=\"On Career Karma, learn about how to replace items in a list using indexing, list comprehensions, and a for loop.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/\" \/>\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=\"2021-01-14T12:10:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T12:08:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/alejandro-escamilla-xII7efH1G6o-unsplash.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-replace-item-in-list\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Replace Item in List in Python: A Complete Guide\",\"datePublished\":\"2021-01-14T12:10:27+00:00\",\"dateModified\":\"2023-12-01T12:08:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/\"},\"wordCount\":962,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/alejandro-escamilla-xII7efH1G6o-unsplash.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/\",\"name\":\"Replace Item in List in Python: A Complete Guide: A Complete Guide\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/alejandro-escamilla-xII7efH1G6o-unsplash.jpg\",\"datePublished\":\"2021-01-14T12:10:27+00:00\",\"dateModified\":\"2023-12-01T12:08:06+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"On Career Karma, learn about how to replace items in a list using indexing, list comprehensions, and a for loop.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/alejandro-escamilla-xII7efH1G6o-unsplash.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/alejandro-escamilla-xII7efH1G6o-unsplash.jpg\",\"width\":1020,\"height\":680},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/#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\":\"Replace Item in List in Python: A Complete 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":"Replace Item in List in Python: A Complete Guide: A Complete Guide","description":"On Career Karma, learn about how to replace items in a list using indexing, list comprehensions, and a for loop.","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-replace-item-in-list\/","og_locale":"en_US","og_type":"article","og_title":"Replace Item in List in Python: A Complete Guide","og_description":"On Career Karma, learn about how to replace items in a list using indexing, list comprehensions, and a for loop.","og_url":"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2021-01-14T12:10:27+00:00","article_modified_time":"2023-12-01T12:08:06+00:00","og_image":[{"width":1020,"height":680,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/alejandro-escamilla-xII7efH1G6o-unsplash.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-replace-item-in-list\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Replace Item in List in Python: A Complete Guide","datePublished":"2021-01-14T12:10:27+00:00","dateModified":"2023-12-01T12:08:06+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/"},"wordCount":962,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/alejandro-escamilla-xII7efH1G6o-unsplash.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/","url":"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/","name":"Replace Item in List in Python: A Complete Guide: A Complete Guide","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/alejandro-escamilla-xII7efH1G6o-unsplash.jpg","datePublished":"2021-01-14T12:10:27+00:00","dateModified":"2023-12-01T12:08:06+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"On Career Karma, learn about how to replace items in a list using indexing, list comprehensions, and a for loop.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/alejandro-escamilla-xII7efH1G6o-unsplash.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/alejandro-escamilla-xII7efH1G6o-unsplash.jpg","width":1020,"height":680},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/python-replace-item-in-list\/#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":"Replace Item in List in Python: A Complete 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\/21518","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=21518"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/21518\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/21519"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=21518"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=21518"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=21518"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}