{"id":24340,"date":"2020-10-15T11:50:17","date_gmt":"2020-10-15T18:50:17","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=24340"},"modified":"2023-12-01T04:01:35","modified_gmt":"2023-12-01T12:01:35","slug":"nameerror-name-xrange-is-not-defined","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/","title":{"rendered":"Python NameError: name \u2018xrange\u2019 is not defined Solution"},"content":{"rendered":"\n<p>In <a href=\"https:\/\/careerkarma.com\/blog\/python-2-vs-python-3\/\">Python 3<\/a>, the xrange function was removed. If you try to use the xrange function in a Python 3 program, you\u2019ll encounter the <code>NameError: name \u2018xrange\u2019 is not defined<\/code> error.<br><\/p>\n\n\n\n<p>In this guide, we\u2019re going to discuss what this error means and why you may encounter it. We\u2019ll discuss an example of this error so you can learn how to fix it in your code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">NameError: name \u2018xrange\u2019 is not defined<\/h2>\n\n\n\n<p>In Python 2, the xrange function lets you create a range of numbers. Consider the following code snippet:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>print(xrange(0, 3))<\/pre><\/div>\n\n\n\n<p>Our code returns [0, 1, 2], which is all the numbers in the range of 0 and 3 (exclusive of 3). The <code>xrange()<\/code> function returns a list of numbers.<br><\/p>\n\n\n\n<p>Python 3 removed the <code>xrange()<\/code> function in favor of a <a href=\"https:\/\/careerkarma.com\/blog\/python-range\/\">new function called range()<\/a>. The <code>range()<\/code> function, like <code>xrange()<\/code>, produces a range of numbers.<br><\/p>\n\n\n\n<p>There are two differences between <code>xrange()<\/code> and <code>range()<\/code>;<br><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>xrange()<\/code> and <code>range()<\/code> have different names.<\/li><li>The <code>xrange()<\/code> function generates a list of numbers. The <code>range()<\/code> function generates an object.<\/li><\/ul>\n\n\n\n<p>Because the <code>range()<\/code> function generates an object, you have to convert it into a list if you want to view a list of numbers. Otherwise, these two methods function in the same way.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">An Example Scenario<\/h2>\n\n\n\n<p>We\u2019re going to write a program that displays the first few players who are at the top of a card game leaderboard. To start, let\u2019s <a href=\"https:\/\/careerkarma.com\/blog\/how-to-initialize-a-list-in-python\/\">declare our leaderboard as a list<\/a>:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>leaderboard = [&quot;Alex&quot;, &quot;Jonas&quot;, &quot;Emma&quot;, &quot;Kate&quot;]<\/pre><\/div>\n\n\n\n<p>Next, we\u2019re going to ask the user how many scores they would like to view:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>to_view = int(input(&quot;How many scores would you like to view? &quot;))<\/pre><\/div>\n\n\n\n<p>We convert the value that a user inserts into an integer. This is because the <code>xrange()<\/code> function only supports integers.<br><\/p>\n\n\n\n<p>Next, let\u2019s iterate over our leaderboard list using a <a href=\"https:\/\/careerkarma.com\/blog\/python-for-loop\/\">for loop<\/a>. We will only display the number of results that the user has requested to view on the console:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>for l in xrange(0, to_view):\n\tprint(l + 1, leaderboard[l])<\/pre><\/div>\n\n\n\n<p>We use the <code>xrange()<\/code> function to generate a range of numbers between 0 and the number the user inserted. In our for loop, we use a <code>print()<\/code> statement to print out the leaderboard entry that correlates with the number in the <code>xrange()<\/code> list that our loop is viewing.<br><\/p>\n\n\n\n<p>We print out the value of \u201cl\u201d plus one alongside the name of a player. This lets us see their position. Because <a href=\"https:\/\/careerkarma.com\/blog\/python-index\/\">lists are indexed from zero<\/a>, we add one to \u201cl\u201d. This prevents the first player on our list being at position \u201c0\u201d and so on.<br><\/p>\n\n\n\n<p>Let\u2019s run our code and see what happens:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>How many scores would you like to view? 2\nTraceback (most recent call last):\n  File &quot;main.py&quot;, line 5, in &lt;module&gt;\n\tfor l in xrange(0, to_view):\nNameError: name 'xrange' is not defined<\/pre><\/div>\n\n\n\n<p>Our program returns an error.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Solution<\/h2>\n\n\n\n<p>We\u2019ve used the <code>xrange()<\/code> function to generate a range of numbers. In Python 2, this would be valid. We are using Python 3 to run our program, which means we cannot reference the <code>xrange()<\/code> function.<br><\/p>\n\n\n\n<p>To solve our error, we need to replace <code>xrange()<\/code> with the <code>range()<\/code> method:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>for l in range(0, to_view):\n\tprint(l + 1, leaderboard[l])<\/pre><\/div>\n\n\n\n<p>For this use case, both <code>xrange()<\/code> and <code>range()<\/code> will return the same result. Let\u2019s run our code to see if it works:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>How many scores would you like to view? 2\n1 Alex\n2 Jonas<\/pre><\/div>\n\n\n\n<p>Our program successfully displays the names of the players in the tournament who appear in the first two positions on the leaderboard.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Redefining the xrange() Method<\/h2>\n\n\n\n<p>A potential solution to this problem is to define a variable called xrange at the start of your program that is equal to the <code>range()<\/code> function:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>xrange = range<\/pre><\/div>\n\n\n\n<p>This is not a good solution to this error. This is because you are merely avoiding the problem of renaming existing methods. It would be confusing for someone to read through a Python 3 codebase and see <code>xrange()<\/code> statements, even if you have defined xrange as a variable.<br><\/p>\n\n\n\n<p>The best solution is to rename your <code>xrange()<\/code> statements to <code>range()<\/code> and to make any necessary changes to ensure your codebase works in Python 3.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The \u201cNameError: name \u2018xrange\u2019 is not defined\u201d error is raised when you try to use the <code>xrange()<\/code> method to create a range of numbers in Python 3. To solve this error, update your code to use the <code>range()<\/code> method that comes with Python 3.<br><\/p>\n\n\n\n<p><code>range()<\/code> is the Python 3 replacement for <code>xrange()<\/code>. Now you have the know-how you need to solve this error like a pro!<\/p>\n","protected":false},"excerpt":{"rendered":"In Python 3, the xrange function was removed. If you try to use the xrange function in a Python 3 program, you\u2019ll encounter the NameError: name \u2018xrange\u2019 is not defined error. In this guide, we\u2019re going to discuss what this error means and why you may encounter it. We\u2019ll discuss an example of this error&hellip;","protected":false},"author":240,"featured_media":24341,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[],"class_list":{"0":"post-24340","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 NameError: name \u2018xrange\u2019 is not defined Solution | Career Karma<\/title>\n<meta name=\"description\" content=\"On Career Karma, learn about the Python NameError: name \u2018xrange\u2019 is not defined error, why the error is raised, 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\/nameerror-name-xrange-is-not-defined\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python NameError: name \u2018xrange\u2019 is not defined Solution\" \/>\n<meta property=\"og:description\" content=\"On Career Karma, learn about the Python NameError: name \u2018xrange\u2019 is not defined error, why the error is raised, and how to solve the error.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/\" \/>\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-10-15T18:50:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T12:01:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/altumcode-dC6Pb2JdAqs-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"718\" \/>\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=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Python NameError: name \u2018xrange\u2019 is not defined Solution\",\"datePublished\":\"2020-10-15T18:50:17+00:00\",\"dateModified\":\"2023-12-01T12:01:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/\"},\"wordCount\":638,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/altumcode-dC6Pb2JdAqs-unsplash.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/\",\"name\":\"Python NameError: name \u2018xrange\u2019 is not defined Solution | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/altumcode-dC6Pb2JdAqs-unsplash.jpg\",\"datePublished\":\"2020-10-15T18:50:17+00:00\",\"dateModified\":\"2023-12-01T12:01:35+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"On Career Karma, learn about the Python NameError: name \u2018xrange\u2019 is not defined error, why the error is raised, and how to solve the error.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/altumcode-dC6Pb2JdAqs-unsplash.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/altumcode-dC6Pb2JdAqs-unsplash.jpg\",\"width\":1020,\"height\":718},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/#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 NameError: name \u2018xrange\u2019 is not defined 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 NameError: name \u2018xrange\u2019 is not defined Solution | Career Karma","description":"On Career Karma, learn about the Python NameError: name \u2018xrange\u2019 is not defined error, why the error is raised, 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\/nameerror-name-xrange-is-not-defined\/","og_locale":"en_US","og_type":"article","og_title":"Python NameError: name \u2018xrange\u2019 is not defined Solution","og_description":"On Career Karma, learn about the Python NameError: name \u2018xrange\u2019 is not defined error, why the error is raised, and how to solve the error.","og_url":"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-10-15T18:50:17+00:00","article_modified_time":"2023-12-01T12:01:35+00:00","og_image":[{"width":1020,"height":718,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/altumcode-dC6Pb2JdAqs-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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Python NameError: name \u2018xrange\u2019 is not defined Solution","datePublished":"2020-10-15T18:50:17+00:00","dateModified":"2023-12-01T12:01:35+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/"},"wordCount":638,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/altumcode-dC6Pb2JdAqs-unsplash.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/","url":"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/","name":"Python NameError: name \u2018xrange\u2019 is not defined Solution | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/altumcode-dC6Pb2JdAqs-unsplash.jpg","datePublished":"2020-10-15T18:50:17+00:00","dateModified":"2023-12-01T12:01:35+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"On Career Karma, learn about the Python NameError: name \u2018xrange\u2019 is not defined error, why the error is raised, and how to solve the error.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/altumcode-dC6Pb2JdAqs-unsplash.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/10\/altumcode-dC6Pb2JdAqs-unsplash.jpg","width":1020,"height":718},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/nameerror-name-xrange-is-not-defined\/#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 NameError: name \u2018xrange\u2019 is not defined 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\/24340","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=24340"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/24340\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/24341"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=24340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=24340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=24340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}