{"id":12282,"date":"2021-01-19T23:57:48","date_gmt":"2021-01-20T07:57:48","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=12282"},"modified":"2023-12-01T04:08:51","modified_gmt":"2023-12-01T12:08:51","slug":"python-index","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/python-index\/","title":{"rendered":"Python Index: A Step-By-Step Guide"},"content":{"rendered":"\n<p><em>The Python index() method returns the index position at which an item is found in a list or a string. index() returns the lowest resulting index for the item. A ValueError is returned if the specified item does exist in the list.<\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>You may want to find the index of a particular element within your data. For example, say you have a list of the top ten baked goods sold at a bakery. You may want to find out the position of <em>Banana Cake<\/em> in that list.<\/p>\n\n\n\n<p>That\u2019s where the Python <em>index()<\/em> method comes in. <em>index()<\/em> returns the index value at which a particular item appears in a list or a string. For this tutorial, we are going to look at the <em>index()<\/em> method in-depth, with reference to an example.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python index() Method<\/h2>\n\n\n\n<p>The Python index() method returns the index position of an item in a list or a character or range of characters in a string. This method accepts one argument: the item you want to find in your list or string.<\/p>\n\n\n\n<p>The <em>index()<\/em> method uses the same syntax whether you&#8217;re looking for an item in a list or a string. This is because the items in both the list and string data types are identified by index numbers.<\/p>\n\n\n\n<p>Let&#8217;s look at the syntax for the <em>index()<\/em> method:<\/p>\n\n\n\n<p>value_name.index(item, start_pos_end_pos)<\/p>\n\n\n\n<p>The <em>index()<\/em> string method takes three parameters:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>value is the value for which we want to search in our string or list (required).<\/li><li><em>start_pos<\/em> is the index position at which our search should begin (optional).<\/li><li><em>end_pos<\/em> is the index position at which our search should end (optional).<\/li><\/ul>\n\n\n\n<p>If the item for which you are looking is not in the final list, the interpreter will return a Python ValueError.<\/p>\n\n\n\n<p><em>index()<\/em> returns the first instance of an item in a list or a character or phrase in a string.<\/p>\n\n\n\n<p>If you want to find the second instance of a list item or string character or phrase, you need to find the first instance. Then, you can begin your search at the character after the first instance begins. This means that Python will not find the instance that you have already found again.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python List index()<\/h2>\n\n\n\n<p>The list <em>index()<\/em> Python method returns the index number at which a particular element appears in a list. <em>index()<\/em> will return the first index position at which the item appears if there are multiple instances of the item.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Python String index() Example<\/h3>\n\n\n\n<p>Say that you are the organizer for the local fun run. You have been asked to create a program that allows people to find out their rank in the race.<\/p>\n\n\n\n<p>You have a list of every participant that is ordered by the times in which they completed the race. Your goal is to create a program that gets the index value of an element in a list.<\/p>\n\n\n\n<p>We could find the index value of a person in our list of participants using this code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>participants = ['Leslie Tucker', 'Peter Free', 'Luke Oliver', 'Ernie Bolton']\nparticipant_name = 'Ernie Bolton'\nindex_of_participant = participants.index(participant_name)\n\nprint(index_of_participant)<\/pre><\/div>\n\n\n\n<p>Our code returns the index of the element for which we are looking:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>3<\/pre><\/div>\n\n\n\n<p>On the first line of our code, we declare a <a href=\"https:\/\/careerkarma.com\/blog\/python-array\/\">Python array<\/a> called <em>participants.<\/em> This array stores the names of every participant in the race, ordered by their finishing times in the race. On the next line, we declare a <a href=\"https:\/\/careerkarma.com\/blog\/python-variables\/\">Python variable<\/a> that stores the name of the person whose rank we want to retrieve.<\/p>\n\n\n\n<p>Next, we use the built-in Python <em>index()<\/em> method to find the index of our participant\u2019s name, which in this case is <em>Ernie Bolton<\/em>. On the final line, we print out the index value that the <em>index()<\/em> method returned. Because <em>Ernie Bolton<\/em> appears at index position 3 in our list, our program returns 3.<\/p>\n\n\n\n<p>The <em>index()<\/em> method only returns the first occurrence of an item in an array. So, if you have multiple of the same value in an array, only the index position for the first value will be returned.<\/p>\n\n\n\n<p>In addition, if the item you\u2019re looking for does not exist in an array, a ValueError will be returned. Here\u2019s an example of our above program searching for <em>Lindsay Paulson<\/em> in our list, who did not participate:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>participants = ['Leslie Tucker', 'Peter Free', 'Luke Oliver', 'Ernie Bolton']\nparticipant_name = 'Lindsay Paulson'\nindex_of_participant = participants.index(participant_name)\n\nprint(index_of_participant)<\/pre><\/div>\n\n\n\n<p>Our program returns: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>ValueError: 'Lindsay Paulson' is not in list<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Python String index()<\/h2>\n\n\n\n<p>The Python string <em>index()<\/em> method finds index value at which a particular substring appears in a string. If the <a href=\"https:\/\/careerkarma.com\/blog\/python-substring\/\">Python substring<\/a> is found, the <em>index()<\/em> method will return the index value at which the substring starts. Otherwise, an error is raised.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Python String index() Example<\/h3>\n\n\n\n<p>Say that we have a string of student names, and we want to know when the name <em>Joey<\/em> appears in our string. We could use the following code to accomplish this task:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>student_names = 'Judith Joey Fred Luke Linda'\n\nindex_position_of_joey = student_names.index('Joey')\n\nprint(index_position_of_joey)<\/pre><\/div>\n\n\n\n<p>Our code returns: <em>7<\/em>.<\/p>\n\n\n\n<p>We first declare a variable called <em>student_names<\/em> that stores our student names in a string. Then, on the next line, we use the <em>index()<\/em> function to find the index position at which <em>Joey<\/em> starts in the string. Finally, we print out that value to the console, which in this case was 7.<\/p>\n\n\n\n<p>Let\u2019s say that there are two &#8220;Joey&#8221;s in our class. We want to find the second instance of his name in the string. We know that the first Joey\u2019s name starts at the index value 7. We can use the <em>start<\/em> parameter to skip over all characters before the index value 7 and continue our search. <\/p>\n\n\n\n<p>Let&#8217;s find the second &#8220;Joey&#8221; sequence of characters in our list:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>student_names = 'Judith Joey Fred Luke Linda Joey'\n\nindex_position_of_joey = student_names.index('Joey', 8)\n\nprint(index_position_of_joey)<\/pre><\/div>\n\n\n\n<p>Our code returns: <em>28<\/em>.<\/p>\n\n\n\n<p>By specifying a start parameter of 8, our code knows not to look for <em>Joey<\/em> in any index position at 7 or below. So, our code returns 28, which is the index value at which the second Joey appears in our string.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Specifying an End Parameter<\/h3>\n\n\n\n<p>Similarly, you can specify an end parameter to indicate when the search should end. Say we\u2019re looking for Fred\u2019s name in our string.  We know that his name comes before the second Joey.<\/p>\n\n\n\n<p>To find Fred&#8217;s name, knowing the name comes after the second Joey, we could use this code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>student_names = 'Judith Joey Fred Luke Linda Joey'\n\nindex_position_of_joey = student_names.index('Fred', 8, 28)\n\nprint(index_position_of_joey)<\/pre><\/div>\n\n\n\n<p>Our code returns: <em>12<\/em>.<\/p>\n\n\n\n<p>The <em>index()<\/em> method only conducts a search between the index values 8 and 28 in our string. This method returns 12, the position at which Fred\u2019s name starts in our string.<\/p>\n\n\n\n<p>Now, let\u2019s say that we are looking for Hannah in our string, who has not yet been added to our class. This will result in a ValueError being returned by our program because her name does not yet exist. Here\u2019s this scenario written out in code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>student_names = 'Judith Joey Fred Luke Linda Joey'\n\nindex_position_of_joey = student_names.index('Hannah')\n\nprint(index_position_of_joey)<\/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>ValueError: substring not found<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The Python index() method finds the index position of an item in an array or a character or phrase in a string. The syntax for this method is: string.index(item, start, end).<\/p>\n\n\n\n<p>In this tutorial, we discussed the Python array <em>index()<\/em> method and the string <em>index()<\/em> method. We explored the syntax for each of these methods and a few examples to accompany the knowledge.<\/p>\n\n\n\n<p>Do you want to learn more about the Python programming language? Read our <a href=\"https:\/\/careerkarma.com\/blog\/how-to-learn-python\/\">How to Learn Python guide<\/a>. This guide contains a list of top learning resources that can help you acquire the skills you need to become a Python expert.<\/p>\n","protected":false},"excerpt":{"rendered":"The Python index() method returns the index position at which an item is found in a list or a string. index() returns the lowest resulting index for the item. A ValueError is returned if the specified item does exist in the list. You may want to find the index of a particular element within your&hellip;","protected":false},"author":240,"featured_media":12600,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[],"class_list":{"0":"post-12282","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>Python Index: A Step-By-Step Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"The Python index method gets the index value for an item in an array or a string. Learn how to use the index method on Career Karma.\" \/>\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-index\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Index: A Step-By-Step Guide\" \/>\n<meta property=\"og:description\" content=\"The Python index method gets the index value for an item in an array or a string. Learn how to use the index method on Career Karma.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/python-index\/\" \/>\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-20T07:57:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T12:08:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/python-index-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\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=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-index\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-index\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Python Index: A Step-By-Step Guide\",\"datePublished\":\"2021-01-20T07:57:48+00:00\",\"dateModified\":\"2023-12-01T12:08:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-index\/\"},\"wordCount\":1198,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-index\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/python-index-1.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-index\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-index\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/python-index\/\",\"name\":\"Python Index: A Step-By-Step Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-index\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-index\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/python-index-1.jpg\",\"datePublished\":\"2021-01-20T07:57:48+00:00\",\"dateModified\":\"2023-12-01T12:08:51+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"The Python index method gets the index value for an item in an array or a string. Learn how to use the index method on Career Karma.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-index\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-index\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-index\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/python-index-1.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/python-index-1.jpg\",\"width\":1200,\"height\":675,\"caption\":\"Python Index\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-index\/#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 Index: A Step-By-Step 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 Index: A Step-By-Step Guide | Career Karma","description":"The Python index method gets the index value for an item in an array or a string. Learn how to use the index method on Career Karma.","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-index\/","og_locale":"en_US","og_type":"article","og_title":"Python Index: A Step-By-Step Guide","og_description":"The Python index method gets the index value for an item in an array or a string. Learn how to use the index method on Career Karma.","og_url":"https:\/\/careerkarma.com\/blog\/python-index\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2021-01-20T07:57:48+00:00","article_modified_time":"2023-12-01T12:08:51+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/python-index-1.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":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/python-index\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/python-index\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Python Index: A Step-By-Step Guide","datePublished":"2021-01-20T07:57:48+00:00","dateModified":"2023-12-01T12:08:51+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-index\/"},"wordCount":1198,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-index\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/python-index-1.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/python-index\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/python-index\/","url":"https:\/\/careerkarma.com\/blog\/python-index\/","name":"Python Index: A Step-By-Step Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-index\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-index\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/python-index-1.jpg","datePublished":"2021-01-20T07:57:48+00:00","dateModified":"2023-12-01T12:08:51+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"The Python index method gets the index value for an item in an array or a string. Learn how to use the index method on Career Karma.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/python-index\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/python-index\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/python-index\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/python-index-1.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/python-index-1.jpg","width":1200,"height":675,"caption":"Python Index"},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/python-index\/#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 Index: A Step-By-Step 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\/12282","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=12282"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/12282\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/12600"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=12282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=12282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=12282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}