{"id":22398,"date":"2020-09-10T12:20:00","date_gmt":"2020-09-10T19:20:00","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=22398"},"modified":"2023-12-01T03:59:34","modified_gmt":"2023-12-01T11:59:34","slug":"python-valueerror-built-in-function-or-method-is-not-iterable","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/","title":{"rendered":"Python ValueError: not enough values to unpack Solution"},"content":{"rendered":"\n<p>Unpacking syntax lets you separate the values from <a href=\"https:\/\/careerkarma.com\/blog\/how-to-initialize-a-list-in-python\/\">iterable objects<\/a>. If you try to unpack more values than the total that exist in an iterable object, you\u2019ll encounter the \u201cValueError: not enough values to unpack\u201d error.<br><\/p>\n\n\n\n<p>This guide discusses what this error means and why you may see it in your code. We\u2019ll walk through an example of this error in action so you can see how it works.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ValueError: not enough values to unpack<\/h2>\n\n\n\n<p>Iterable objects like lists can be \u201cunpacked\u201d. This lets you assign the values from an iterable object into multiple variables.<br><\/p>\n\n\n\n<p>Unpacking is common when you want to retrieve multiple values from the response of a function call, when you want to split a list into two or more variables depending on the position of the items in the list, or when you want to <a href=\"https:\/\/careerkarma.com\/blog\/iterate-through-dictionary-python\/\">iterate over a dictionary using the items() method<\/a>.<br><\/p>\n\n\n\n<p>Consider the following example:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>name, address = [&quot;John Doe&quot;, &quot;123 Main Street&quot;]<\/pre><\/div>\n\n\n\n<p>This code unpacks the values from our list into two variables: name and address. The variable \u201cname\u201d will be given the value \u201cJohn Doe\u201d and the variable address will be assigned the value \u201c123 Main Street\u201d.<br><\/p>\n\n\n\n<p>You have to unpack every item in an iterable if you use unpacking. You cannot unpack fewer or more values than exist in an iterable. This is because Python would not know which values should be assigned to which variables.<\/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 calculates the total sales of a product at a cheese store on a given day. To start, we\u2019re going to ask the user to insert two pieces of information: the name of a cheese and a list of all the sales that have been made.<br><\/p>\n\n\n\n<p>We can do this using an <a href=\"https:\/\/careerkarma.com\/blog\/python-input\/\">input() statement<\/a>:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>name = input(&quot;Enter the name of a cheese: &quot;)\nsales = input(&quot;Enter a comma-separated list of all purchases made of this cheese: &quot;)<\/pre><\/div>\n\n\n\n<p>Our \u201csales\u201d variable expects the user to insert a list of sales. Each value should be separated using a comma.<br><\/p>\n\n\n\n<p>Next, <a href=\"https:\/\/careerkarma.com\/blog\/python-functions\/\">define a function<\/a> that calculates the total of all the sales made for a particular cheese. This function will also designate a cheese as a \u201ctop seller\u201d if more than $50 has been sold in the last day.<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>def calculate_total_sales(sales):\n\t    split_sales = [float(x) for x in sales.split(&quot;,&quot;)]\n\t    total_sales = sum(split_sales)\n\t    if total_sales &gt; 50.00:\n\t\t         top_seller = True\n\t    else:\n\t  \t         top_seller = False\n\n\t    return [total_sales]<\/pre><\/div>\n\n\n\n<p>The <a href=\"https:\/\/careerkarma.com\/blog\/python-split\/\">split() method<\/a> turns the values the user gives us into a list. We use a <a href=\"https:\/\/careerkarma.com\/blog\/python-list-comprehension\/\">list comprehension<\/a> to turn each value from our string into a float and put that number in a list.<br><\/p>\n\n\n\n<p>We use the <a href=\"https:\/\/careerkarma.com\/blog\/python-sum\/\">sum() method<\/a> to calculate the total value of all the purchases for a given cheese based on the list that the <code>split()<\/code> method returns. We then use an <code>if<\/code> statement to determine whether a cheese is a top seller.<br><\/p>\n\n\n\n<p>Our method returns an iterable with one item: the total sales made. We return an iterable so we can unpack it later in our program. Next, call our function:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>total_sales, top_seller = calculate_total_sales(sales)<\/pre><\/div>\n\n\n\n<p>Our function accepts one parameter: the list of purchases. We unpack the result of our function into two parts: total_sales and top_seller.<br><\/p>\n\n\n\n<p>Finally, print out the values that our function calculates:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>print(&quot;Total Sales: $&quot; + str(round(total_sales, 2))\nprint(&quot;Top Seller: &quot; + str(top_seller))<\/pre><\/div>\n\n\n\n<p>We convert our variables to strings so we can concatenate them to our labels. We round the value of \u201ctotal_sales\u201d to two decimal places using the <code>round()<\/code> method. Let\u2019s run our program and see if it works:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Enter the name of a cheese: Edam\nEnter a comma-separated list of all purchases made of this cheese: 2.20, 2.90, 3.30\nTraceback (most recent call last):\n  File &quot;main.py&quot;, line 15, in &lt;module&gt;\n\ttotal_sales, top_seller = calculate_total_sales(sales)\nValueError: not enough values to unpack (expected 2, got 1)<\/pre><\/div>\n\n\n\n<p>Our program fails to execute.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Solution<\/h2>\n\n\n\n<p>The <code>calculate_total_sales()<\/code> function only returns one value: the total value of all the sales made of a particular cheese. However, we are trying to unpack two values from that function.<br><\/p>\n\n\n\n<p>This causes an error because Python is expecting a second value to unpack. To solve this error, we have to return the \u201ctop_seller\u201d value into our main program:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>def calculate_total_sales(sales):\n\t    split_sales = [float(x) for x in sales.split(&quot;,&quot;)]\n\t    total_sales = sum(split_sales)\n\t    if total_sales &gt; 50.00:\n\t\t         top_seller = True\n\t    else:\n\t\t         top_seller = False\n\n\t    return [total_sales, top_seller]<\/pre><\/div>\n\n\n\n<p>Our function now returns a list with two values: total_sales and top_seller. These two values can be unpacked by our program because they appear in a list. Let\u2019s run our program and see if it works:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Enter the name of a cheese: Edam\nEnter a comma-separated list of all purchases made of this cheese: 2.20, 2.90, 3.30\nTotal Sales: $8.4\nTop Seller: False<\/pre><\/div>\n\n\n\n<p>Our program now successfully displays the total sales of a cheese and whether that cheese is a top seller to the console.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The \u201cValueError: not enough values to unpack\u201d error is raised when you try to unpack more values from an iterable object than those that exist. To fix this error, make sure the number of values you unpack from an iterable is equal to the number of values in that iterable.<br><\/p>\n\n\n\n<p>Now you have the knowledge you need to fix this common Python error like an expert!<\/p>\n","protected":false},"excerpt":{"rendered":"Unpacking syntax lets you separate the values from iterable objects. If you try to unpack more values than the total that exist in an iterable object, you\u2019ll encounter the \u201cValueError: not enough values to unpack\u201d error. This guide discusses what this error means and why you may see it in your code. We\u2019ll walk through&hellip;","protected":false},"author":240,"featured_media":5157,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[],"class_list":{"0":"post-22398","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 ValueError: not enough values to unpack Solution | Career Karma<\/title>\n<meta name=\"description\" content=\"The ValueError: not enough values to unpack error is raised when you try to unpack too many values from an iterable. On Career Karma, learn how to solve this Python 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-valueerror-built-in-function-or-method-is-not-iterable\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python ValueError: not enough values to unpack Solution\" \/>\n<meta property=\"og:description\" content=\"The ValueError: not enough values to unpack error is raised when you try to unpack too many values from an iterable. On Career Karma, learn how to solve this Python error.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/\" \/>\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-09-10T19:20:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T11:59:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2019\/08\/safar-safarov-MSN8TFhJ0is-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"667\" \/>\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-valueerror-built-in-function-or-method-is-not-iterable\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Python ValueError: not enough values to unpack Solution\",\"datePublished\":\"2020-09-10T19:20:00+00:00\",\"dateModified\":\"2023-12-01T11:59:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/\"},\"wordCount\":727,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2019\/08\/safar-safarov-MSN8TFhJ0is-unsplash.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/\",\"name\":\"Python ValueError: not enough values to unpack Solution | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2019\/08\/safar-safarov-MSN8TFhJ0is-unsplash.jpg\",\"datePublished\":\"2020-09-10T19:20:00+00:00\",\"dateModified\":\"2023-12-01T11:59:34+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"The ValueError: not enough values to unpack error is raised when you try to unpack too many values from an iterable. On Career Karma, learn how to solve this Python error.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2019\/08\/safar-safarov-MSN8TFhJ0is-unsplash.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2019\/08\/safar-safarov-MSN8TFhJ0is-unsplash.jpg\",\"width\":1000,\"height\":667,\"caption\":\"Laptop with code on screen sitting on desk next to potted plants\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/#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 ValueError: not enough values to unpack 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 ValueError: not enough values to unpack Solution | Career Karma","description":"The ValueError: not enough values to unpack error is raised when you try to unpack too many values from an iterable. On Career Karma, learn how to solve this Python 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-valueerror-built-in-function-or-method-is-not-iterable\/","og_locale":"en_US","og_type":"article","og_title":"Python ValueError: not enough values to unpack Solution","og_description":"The ValueError: not enough values to unpack error is raised when you try to unpack too many values from an iterable. On Career Karma, learn how to solve this Python error.","og_url":"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-09-10T19:20:00+00:00","article_modified_time":"2023-12-01T11:59:34+00:00","og_image":[{"width":1000,"height":667,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2019\/08\/safar-safarov-MSN8TFhJ0is-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-valueerror-built-in-function-or-method-is-not-iterable\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Python ValueError: not enough values to unpack Solution","datePublished":"2020-09-10T19:20:00+00:00","dateModified":"2023-12-01T11:59:34+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/"},"wordCount":727,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2019\/08\/safar-safarov-MSN8TFhJ0is-unsplash.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/","url":"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/","name":"Python ValueError: not enough values to unpack Solution | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2019\/08\/safar-safarov-MSN8TFhJ0is-unsplash.jpg","datePublished":"2020-09-10T19:20:00+00:00","dateModified":"2023-12-01T11:59:34+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"The ValueError: not enough values to unpack error is raised when you try to unpack too many values from an iterable. On Career Karma, learn how to solve this Python error.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2019\/08\/safar-safarov-MSN8TFhJ0is-unsplash.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2019\/08\/safar-safarov-MSN8TFhJ0is-unsplash.jpg","width":1000,"height":667,"caption":"Laptop with code on screen sitting on desk next to potted plants"},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/python-valueerror-built-in-function-or-method-is-not-iterable\/#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 ValueError: not enough values to unpack 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\/22398","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=22398"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/22398\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/5157"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=22398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=22398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=22398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}