{"id":12167,"date":"2020-11-19T10:02:08","date_gmt":"2020-11-19T18:02:08","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=12167"},"modified":"2023-12-01T04:04:12","modified_gmt":"2023-12-01T12:04:12","slug":"python-reverse-string","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/python-reverse-string\/","title":{"rendered":"Python Reverse String: A Step-By-Step Guide"},"content":{"rendered":"\n<p><em>You can reverse a string in Python using slicing or the reversed() method. A recursive function that reads each character in a string and reverses the entire string is another common way to reverse a string. There is no function <\/em><em>explicitly<\/em><em> designed to reverse a string.<\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>When you\u2019re working in Python, you may have a string that you want to reverse. For instance, say you are creating a game. You may want to allow users to generate a username by submitting their name to the program and having the program reverse it.<\/p>\n\n\n\n<p>String reversal is not a common operation in programming, so Python does not have a built-in function to reverse strings. However, reversing strings is a topic that comes up in job interviews, and it does have a few real-world applications.<\/p>\n\n\n\n<p>In this tutorial, we will discuss three methods you can use to reverse a string n Python. We\u2019ll start with a Python string refresher. Following that, we\u2019ll discuss string slicing. Then, we\u2019ll explore how to use the <em>reversed()<\/em> and <em>join()<\/em> functions. Finally, we\u2019ll look at recursion.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Reverse a String in Python<\/h2>\n\n\n\n<p>There are three methods you can use to reverse a string:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Slicing the string with the <em>[::-1]<\/em> syntax<\/li><li>Using the reversed() function to create a reverse iterator that reads a string and reverses its contents<\/li><li>Using a recursive function<\/li><\/ul>\n\n\n\n<p>Let&#8217;s discuss all three of these methods.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Python Reverse String Using Slicing<\/h3>\n\n\n\n<p>When you\u2019re <a href=\"https:\/\/careerkarma.com\/blog\/python-substring\/\">slicing a Python string<\/a>, you can use the <em>[::-1]<\/em> slicing sequence to create a reversed copy of the string. This syntax retrieves all the characters in a string and reverses them.<\/p>\n\n\n\n<p>Suppose we have a string with the value &#8220;Python&#8221;. We want to see this string in reverse order. We could do so using the <em>[::-1]<\/em> syntax:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>string = &quot;Python&quot;\nreversed = string[::-1]\n\nprint(reversed)<\/pre><\/div>\n\n\n\n<p>Our code returns: <em>nohtyP<\/em>.<\/p>\n\n\n\n<p>We declare a <a href=\"https:\/\/careerkarma.com\/blog\/python-variables\/\">Python variable<\/a> called reverse which stores our reversed string. The <em>[::-1]<\/em> syntax is added at the end of the variable that contains our &#8220;Python&#8221; string value.<\/p>\n\n\n\n<p>This is an effective method to use because it is short and simple. You only need to add <em>[::-1]<\/em> to the end of a string to reverse it.<\/p>\n\n\n\n<p>This method can appear confusing because the syntax does not clearly convey that it can be used to reverse strings. As a result, many developers avoid using this technique.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Reverse String Python Using reversed()<\/h2>\n\n\n\n<p>Python includes a built-in function that is used to create a reverse iterator: the <em>reversed()<\/em> function. This iterator works because strings are indexed, so each value in a string can be accessed individually.<\/p>\n\n\n\n<p>The reverse iterator is then used to iterate through the elements in a string in reverse order.<\/p>\n\n\n\n<p>Here\u2019s an example that utilizes <em>reversed()<\/em> to create a reverse iterator that prints out our string in reverse order:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>for char in reversed(&quot;Python&quot;):\n\tprint(char)<\/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>n\no\nh\nt\ny\nP<\/pre><\/div>\n\n\n\n<p>In our code, we specify a <a href=\"https:\/\/careerkarma.com\/blog\/python-for-loop\/\">Python <em>for<\/em> loop<\/a> that iterates through each item in the <em>reversed()<\/em> method. You can see that our code has printed out our string in reverse order.<\/p>\n\n\n\n<p>Our code printed each character on a new line. This is because we used <em>reversed()<\/em> with a <em>for<\/em> loop. If we wanted our string to appear on a single line, we would need to use <em>reversed()<\/em> with the <em>join()<\/em> method.<\/p>\n\n\n\n<p>We can use the <em>join()<\/em> method to merge all the characters from our <em>reversed()<\/em> iterator into one string.<\/p>\n\n\n\n<p>Here\u2019s an example that uses <em>reversed()<\/em> and <em>join()<\/em> to reverse a Python string:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>&quot;&quot;.join(reversed(&quot;Python&quot;))<\/pre><\/div>\n\n\n\n<p>Our code returns: <em>nohtyP<\/em>.<\/p>\n\n\n\n<p>This method of reversing strings is useful because, like the slicing method discussed above, it is compact and concise. This method has the added benefit of being easy to read and understand. Even if you hadn\u2019t seen the <em>reversed()<\/em> or <em>join()<\/em> methods before, you would be able to guess what was going on.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Reverse a String Python: Recursion<\/h2>\n\n\n\n<p>Recursion is a term used in computer science to describe a function that calls itself, either directly or indirectly. Here\u2019s an example of reversing a string via <a href=\"https:\/\/careerkarma.com\/blog\/python-recursion\/\">Python recursion<\/a>:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>def reverse_string(string):\n\tif len(string) == 0:\n\t\treturn string\n\telse:\n\t\treturn reverse_string(string[1:]) + string[0]\n\nreverse_string(&quot;Python&quot;)<\/pre><\/div>\n\n\n\n<p>Our code returns: <em>nohtyP<\/em>.<\/p>\n\n\n\n<p>This method uses slicing to reverse our string. Instead of using a single slice operation like we did earlier, we used a Python function called <em>reverse_string<\/em>.<\/p>\n\n\n\n<p>This function slices our string and returns a reversed version. This method is very effective. As a result, many Python developers favor it.<\/p>\n\n\n\n<p>Our function accepts the string we want to reverse. If there are no characters in the string, the value of the string is returned. Otherwise, we call the function again using the string[1:] syntax as an argument. We add the first character in our string to the end of what this function returns.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>While Python does not include a built-in reverse function, there are a few approaches we can use to reverse a string.<\/p>\n\n\n\n<p>We can use the <em>[::-1]<\/em> slicing method to reverse a string through slicing, the <em>reversed()<\/em> and <em>join()<\/em> functions to reverse a string through reverse iteration, or recursion to reverse a string using a recursive function.<\/p>\n\n\n\n<p>In this tutorial, we discussed using slicing, <em>reversed()<\/em> and <em>join()<\/em>, and recursion to reverse a string in Python. We explored an example of each of these string methods in action.<\/p>\n\n\n\n<p>To learn more about writing Python code, read our comprehensive <a href=\"https:\/\/careerkarma.com\/blog\/how-to-learn-python\/\">How to Learn Python guide<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"You can reverse a string in Python using slicing or the reversed() method. A recursive function that reads each character in a string and reverses the entire string is another common way to reverse a string. There is no function explicitly designed to reverse a string. When you\u2019re working in Python, you may have a&hellip;","protected":false},"author":240,"featured_media":12169,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[12687],"class_list":{"0":"post-12167","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python","8":"tag-tutorial"},"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.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Python Reverse String: A Step-By-Step Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"There are a number of ways coders can reverse strings in Python. Learn how to reverse strings using slicing, the reversed and join methods, and recursion 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-reverse-string\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Reverse String: A Step-By-Step Guide\" \/>\n<meta property=\"og:description\" content=\"There are a number of ways coders can reverse strings in Python. Learn how to reverse strings using slicing, the reversed and join methods, and recursion on Career Karma.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/python-reverse-string\/\" \/>\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-11-19T18:02:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T12:04:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-REVERSE-STRING.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"668\" \/>\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-reverse-string\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-reverse-string\\\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Python Reverse String: A Step-By-Step Guide\",\"datePublished\":\"2020-11-19T18:02:08+00:00\",\"dateModified\":\"2023-12-01T12:04:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-reverse-string\\\/\"},\"wordCount\":882,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-reverse-string\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/PYTHON-REVERSE-STRING.jpg\",\"keywords\":[\"tutorial\"],\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-reverse-string\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-reverse-string\\\/\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-reverse-string\\\/\",\"name\":\"Python Reverse String: A Step-By-Step Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-reverse-string\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-reverse-string\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/PYTHON-REVERSE-STRING.jpg\",\"datePublished\":\"2020-11-19T18:02:08+00:00\",\"dateModified\":\"2023-12-01T12:04:12+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"There are a number of ways coders can reverse strings in Python. Learn how to reverse strings using slicing, the reversed and join methods, and recursion on Career Karma.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-reverse-string\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-reverse-string\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-reverse-string\\\/#primaryimage\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/PYTHON-REVERSE-STRING.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/PYTHON-REVERSE-STRING.jpg\",\"width\":1000,\"height\":668},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-reverse-string\\\/#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 Reverse String: 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\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/james-gallagher-150x150.jpg\",\"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 Reverse String: A Step-By-Step Guide | Career Karma","description":"There are a number of ways coders can reverse strings in Python. Learn how to reverse strings using slicing, the reversed and join methods, and recursion 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-reverse-string\/","og_locale":"en_US","og_type":"article","og_title":"Python Reverse String: A Step-By-Step Guide","og_description":"There are a number of ways coders can reverse strings in Python. Learn how to reverse strings using slicing, the reversed and join methods, and recursion on Career Karma.","og_url":"https:\/\/careerkarma.com\/blog\/python-reverse-string\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-11-19T18:02:08+00:00","article_modified_time":"2023-12-01T12:04:12+00:00","og_image":[{"width":1000,"height":668,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-REVERSE-STRING.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-reverse-string\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/python-reverse-string\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Python Reverse String: A Step-By-Step Guide","datePublished":"2020-11-19T18:02:08+00:00","dateModified":"2023-12-01T12:04:12+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-reverse-string\/"},"wordCount":882,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-reverse-string\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-REVERSE-STRING.jpg","keywords":["tutorial"],"articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/python-reverse-string\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/python-reverse-string\/","url":"https:\/\/careerkarma.com\/blog\/python-reverse-string\/","name":"Python Reverse String: A Step-By-Step Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-reverse-string\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-reverse-string\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-REVERSE-STRING.jpg","datePublished":"2020-11-19T18:02:08+00:00","dateModified":"2023-12-01T12:04:12+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"There are a number of ways coders can reverse strings in Python. Learn how to reverse strings using slicing, the reversed and join methods, and recursion on Career Karma.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/python-reverse-string\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/python-reverse-string\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/python-reverse-string\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-REVERSE-STRING.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-REVERSE-STRING.jpg","width":1000,"height":668},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/python-reverse-string\/#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 Reverse String: 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\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","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\/12167","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=12167"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/12167\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/12169"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=12167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=12167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=12167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}