{"id":21181,"date":"2020-08-13T23:11:31","date_gmt":"2020-08-14T06:11:31","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=21181"},"modified":"2023-12-01T03:57:48","modified_gmt":"2023-12-01T11:57:48","slug":"python-typeerror-string-index-out-of-range","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/","title":{"rendered":"Python TypeError: string index out of range Solution"},"content":{"rendered":"\n<p>Like lists, <a href=\"https:\/\/careerkarma.com\/blog\/python-substring\/\">Python strings are indexed<\/a>. This means each value in a string has its own index number which you can use to access that value. If you try to access an index value that does not exist in a string, you\u2019ll encounter a \u201cTypeError: string index out of range\u201d error.<br><\/p>\n\n\n\n<p>In this guide, we discuss what this error means and why it is raised. We walk through an example of this error in action to help you figure out how to solve it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">TypeError: string index out of range<\/h2>\n\n\n\n<p>In Python, strings are indexed starting from 0. Take a look at the string \u201cPineapple\u201d:<br><\/p>\n\n\n\n<table class=\"wp-block-table course-info-table\"><tbody><tr><td>P<\/td><td>i<\/td><td>n<\/td><td>e<\/td><td>a<\/td><td>p<\/td><td>p<\/td><td>l<\/td><td>e<\/td><\/tr><tr><td>0<\/td><td>1<\/td><td>2<\/td><td>3<\/td><td>4<\/td><td>5<\/td><td>6<\/td><td>7<\/td><td>8<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p><\/p>\n\n\n\n<p>\u201cPineapple\u201d contains nine letters. Because strings are indexed from 0, the last letter in our string has the index number 8. The first letter in our string has the index number 0.<br><\/p>\n\n\n\n<p>If we try to access an item at position 9 in our list, we\u2019ll encounter an error. This is because there is no letter at index position 9 for Python to read.<br><\/p>\n\n\n\n<p>The \u201cTypeError: string index out of range\u201d error is common if you forget to take into account that strings are indexed from 0. It&#8217;s also common in for loops that use a <a href=\"https:\/\/careerkarma.com\/blog\/python-range\/\">range() statement<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Example Scenario: Strings Are Indexed From 0<\/h2>\n\n\n\n<p>Take a look at a program that prints out all of the letters in a string on a new line:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>def print_string(sentence):\n\tcount = 0\n\n\twhile count &lt;= len(sentence):\n\t\tprint(sentence[count])\n\t\tcount += 1<\/pre><\/div>\n\n\n\n<p>Our code uses a <a href=\"https:\/\/careerkarma.com\/blog\/do-while-python\/\">while loop<\/a> to loop through every letter in the variable \u201csentence\u201d. Each time a loop executes, our <a href=\"https:\/\/careerkarma.com\/blog\/python-variables\/\">variable<\/a> \u201ccount\u201d is increased by 1. This lets us move on to the next letter when our loop continues.<br><\/p>\n\n\n\n<p>Let\u2019s call our function with an example sentence:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>print_string(&quot;String&quot;)<\/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>S\nt\nr\ni\nn\ng\nTraceback (most recent call last):\n  File &quot;main.py&quot;, line 8, in &lt;module&gt;\n\tprint_string(&quot;test&quot;)\n  File &quot;main.py&quot;, line 5, in print_string\n\tprint(sentence[count])\nIndexError: string index out of range<\/pre><\/div>\n\n\n\n<p>Our code prints out each character in our string. After every character is printed, an error is raised. This is because our while loop continues until \u201ccount\u201d is no longer less than or equal to the length of \u201csentence\u201d.<br><\/p>\n\n\n\n<p>To solve this error, we must ensure our while loop only runs when \u201ccount\u201d is less than the length of our string. This is because strings are indexed from 0 and the <code>len()<\/code> method returns the full length of a string. So, the length of \u201cstring\u201d is 6. However, there is no character at index position 6 in our string.<br><\/p>\n\n\n\n<p>Let\u2019s revise our while loop:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>while count &lt; len(sentence):<\/pre><\/div>\n\n\n\n<p>This loop will only run while the value of \u201ccount\u201d is less than the length of \u201csentence\u201d.<br><\/p>\n\n\n\n<p>Run our code and see what happens:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>S\nt\nr\ni\nn\ng<\/pre><\/div>\n\n\n\n<p>Our code runs successfully!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Example Scenario: Hamming Distance Program<\/h2>\n\n\n\n<p>Here, we write a program that calculates the Hamming Distance between two sequences. This tells us how many differences there are between two strings.<br><\/p>\n\n\n\n<p>Start by defining a function that calculates the Hamming distance:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>def hamming(a, b):\n\tdifferences = 0\n\n\tfor c in range(0, len(a)):\n\t\tif a[c] != b[c]:\n\t\t\tdifferences += 1\n\n\treturn differences<\/pre><\/div>\n\n\n\n<p>Our function accepts two arguments: a and b. These arguments contain the string values that we want to compare.<br><\/p>\n\n\n\n<p>In our function, we use a <a href=\"https:\/\/careerkarma.com\/blog\/python-for-loop\/\">for loop<\/a> to go through each position in our strings to see if the characters at that position are the same. If they are not the same, the \u201cdifferences\u201d counter is increased by one.<br><\/p>\n\n\n\n<p>Call our function and try it out with two strings:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>answer = hamming(&quot;Tess1&quot;, &quot;Test&quot;)\nprint(answer)<\/pre><\/div>\n\n\n\n<p>Run our code and see what happens:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Traceback (most recent call last):\n  File &quot;main.py&quot;, line 10, in &lt;module&gt;\n\tanswer = hamming(&quot;Tess1&quot;, &quot;Test&quot;)\n  File &quot;main.py&quot;, line 5, in hamming\n\tif a[c] != b[c]:\nIndexError: string index out of range<\/pre><\/div>\n\n\n\n<p>Our code returns an error. This is because \u201ca\u201d and \u201cb\u201d are not the same length. \u201ca\u201d has one more character than \u201cb\u201d. This causes our loop to try to find another character in \u201cb\u201d that does not exist even after we&#8217;ve searched through all the characters in \u201cb\u201d.<br><\/p>\n\n\n\n<p>We can solve this error by first checking if our strings are valid:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>def hamming(a, b):\n\tdifferences = 0\n\n\tif len(a) != len(b):\n\t\tprint(&quot;Strings must be the same length.&quot;)\n\t\treturn \n\n\tfor c in range(0, len(a)):\n\t\tif a[c] != b[c]:\n\t\t\tdifferences += 1\n\n\treturn differences<\/pre><\/div>\n\n\n\n<p>We\u2019ve used an \u201cif\u201d statement to check if our strings are the same length. If they are, our program will run. If they are not, our program will print a message to the console and our function will return a null value to our main program. Run our code again:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Strings must be the same length.\nNone<\/pre><\/div>\n\n\n\n<p>Our code no longer returns an error. Try our algorithm on strings that have the same length:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>answer = hamming(&quot;Test&quot;, &quot;Tess&quot;)\nprint(answer)<\/pre><\/div>\n\n\n\n<p>Our code returns: 1. Our code has successfully calculated the Hamming Distance between the strings \u201cTest\u201d and \u201cTess\u201d.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The \u201cTypeError: string index out of range\u201d error is raised when you try to access an item at an index position that does not exist. You solve this error by making sure that your code treats strings as if they are indexed from the position 0.<br><\/p>\n\n\n\n<p>Now you\u2019re ready to solve this common Python error like a <a href=\"https:\/\/careerkarma.com\/blog\/is-it-easy-to-learn-python\/\">professional coder<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"Like lists, Python strings are indexed. This means each value in a string has its own index number which you can use to access that value. If you try to access an index value that does not exist in a string, you\u2019ll encounter a \u201cTypeError: string index out of range\u201d error. In this guide, we&hellip;","protected":false},"author":240,"featured_media":18674,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[],"class_list":{"0":"post-21181","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 TypeError: string index out of range Solution | Career Karma<\/title>\n<meta name=\"description\" content=\"On Career Karma, learn about the Python TypeError: string index out of range, how the error works, and how to solve the error.\" \/>\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-typeerror-string-index-out-of-range\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python TypeError: string index out of range Solution\" \/>\n<meta property=\"og:description\" content=\"On Career Karma, learn about the Python TypeError: string index out of range, how the error works, and how to solve the error.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/\" \/>\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-08-14T06:11:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T11:57:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/mark-s-TkEPQPWr2sY-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"679\" \/>\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-typeerror-string-index-out-of-range\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Python TypeError: string index out of range Solution\",\"datePublished\":\"2020-08-14T06:11:31+00:00\",\"dateModified\":\"2023-12-01T11:57:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/\"},\"wordCount\":745,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/mark-s-TkEPQPWr2sY-unsplash.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/\",\"name\":\"Python TypeError: string index out of range Solution | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/mark-s-TkEPQPWr2sY-unsplash.jpg\",\"datePublished\":\"2020-08-14T06:11:31+00:00\",\"dateModified\":\"2023-12-01T11:57:48+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"On Career Karma, learn about the Python TypeError: string index out of range, how the error works, and how to solve the error.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/mark-s-TkEPQPWr2sY-unsplash.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/mark-s-TkEPQPWr2sY-unsplash.jpg\",\"width\":1020,\"height\":679},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/#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 TypeError: string index out of range Solution\"}]},{\"@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 TypeError: string index out of range Solution | Career Karma","description":"On Career Karma, learn about the Python TypeError: string index out of range, how the error works, and how to solve the error.","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-typeerror-string-index-out-of-range\/","og_locale":"en_US","og_type":"article","og_title":"Python TypeError: string index out of range Solution","og_description":"On Career Karma, learn about the Python TypeError: string index out of range, how the error works, and how to solve the error.","og_url":"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-08-14T06:11:31+00:00","article_modified_time":"2023-12-01T11:57:48+00:00","og_image":[{"width":1020,"height":679,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/mark-s-TkEPQPWr2sY-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-typeerror-string-index-out-of-range\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Python TypeError: string index out of range Solution","datePublished":"2020-08-14T06:11:31+00:00","dateModified":"2023-12-01T11:57:48+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/"},"wordCount":745,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/mark-s-TkEPQPWr2sY-unsplash.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/","url":"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/","name":"Python TypeError: string index out of range Solution | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/mark-s-TkEPQPWr2sY-unsplash.jpg","datePublished":"2020-08-14T06:11:31+00:00","dateModified":"2023-12-01T11:57:48+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"On Career Karma, learn about the Python TypeError: string index out of range, how the error works, and how to solve the error.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/mark-s-TkEPQPWr2sY-unsplash.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/mark-s-TkEPQPWr2sY-unsplash.jpg","width":1020,"height":679},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/python-typeerror-string-index-out-of-range\/#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 TypeError: string index out of range Solution"}]},{"@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\/21181","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=21181"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/21181\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/18674"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=21181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=21181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=21181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}