{"id":12850,"date":"2021-01-19T20:06:32","date_gmt":"2021-01-20T04:06:32","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=12850"},"modified":"2023-12-01T04:08:50","modified_gmt":"2023-12-01T12:08:50","slug":"python-average","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/python-average\/","title":{"rendered":"Python Average: A Step-by-Step Guide"},"content":{"rendered":"\n<p><em>There are two ways to find the average of a list of numbers in Python. You can divide the sum() by the len() of a list of numbers to find the average. Or, you can find the average of a list using the Python mean() function.<\/em><\/p>\n\n\n\n<p>Finding the average of a set of values is a common task in Python.<\/p>\n\n\n\n<p>For example, you may have a list of product sales and want to find out the average purchase price. Or, for a diversity report, you may want to calculate the average age of employees who work for your organization.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python Average<\/h2>\n\n\n\n<p>There are two methods employed to find the average of a list of numbers in Python:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>By calculating the sum of the list and then dividing that number by the length of the list. The length of the list is how many values are in the list. or;<\/li><li>By using the statistics.mean() method.<\/li><\/ul>\n\n\n\n<p>While both methods return the average of a list of numbers, there are different factors you should consider when choosing which one to use.<\/p>\n\n\n\n<p>In this tutorial, we discuss how to use the aforementioned approaches to find the average of a list in Python. We&#8217;ll walk through two examples to help you get started.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python Average: Len() and Sum()<\/h2>\n\n\n\n<p>The formula for calculating the average of a list of values is the sum of all terms divided by the number of those terms. We can use the Python sum() and len() values to calculate the average of the numbers in a list.<\/p>\n\n\n\n<p>The Python <em>len()<\/em><a href=\"https:\/\/careerkarma.com\/blog\/python-len\/\"> method<\/a> calculates and returns a count of numbers in a list. <em>len<\/em> is short for length, referring to the length of\u2014or number of\u2014items in a list.<\/p>\n\n\n\n<p>The <em>sum()<\/em> method in Python calculates the total sum of all values in a list.<\/p>\n\n\n\n<p>We can use these functions together to calculate the average value from a list of values.<\/p>\n\n\n\n<p>The basic formula for calculating an average in Python is:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>avg_value = sum(list_of_values) \/ len(list_of_values)<\/pre><\/div>\n\n\n\n<p>This approach is common because you do not have to import any external values to calculate an average.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">sum() and len() Function Example<\/h3>\n\n\n\n<p>Let\u2019s say that we run a coffee shop and want to know the average price of all orders placed so far today. To calculate this number, we could use the sum() and len() methods that we just discussed:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>orders = [2.50, 4.50, 2.00, 2.75, 2.50, 5.00, 8.00, 2.25]\n\naverage = sum(orders) \/ len(orders)\n\nprint(&quot;The average coffee order price today is $&quot; + str(round(average, 2)))<\/pre><\/div>\n\n\n\n<p>We print the average value to the console:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>The average coffee order price today is $3.69<\/pre><\/div>\n\n\n\n<p>On the first line of our code, we define a <a href=\"https:\/\/careerkarma.com\/blog\/python-variables\/\">Python variable<\/a>. This variable stores a list of order prices. Then, we calculate the average of those orders by dividing the <strong>sum<\/strong> of all orders by the <strong>length<\/strong> of our order list. <\/p>\n\n\n\n<p>At the end of our code, we print out a message to the console that tells us the average price of coffee orders.<\/p>\n\n\n\n<p>We use the <a href=\"https:\/\/careerkarma.com\/blog\/python-round\/\">Python <em>round()<\/em> method<\/a> to round our average to two decimal places. The <em>str()<\/em> method to converts our average value into a string that we can print to the console.<\/p>\n\n\n\n<p>Now we know the average coffee order price so far today is $3.69.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python Average: statistics.mean()<\/h2>\n\n\n\n<p>The Python statistics library contains a function called <em>statistics.mean()<\/em> that calculates the mean value of a list of values. The term <em>mean<\/em> is used in mathematics to describe the average of a list of values.<\/p>\n\n\n\n<p>The syntax for the statistics.mean() method is:<\/p>\n\n\n\n<p>statistics.mean(list_of_values)<\/p>\n\n\n\n<p>The <em>mean()<\/em> method takes in one parameter: the list of items whose average you want to calculate.&nbsp;<\/p>\n\n\n\n<p>Before we use this method, we need to import the statistics module (<em>statistics<\/em>) in Python. This is a built-in module that can be used to perform various calculations in Python.<\/p>\n\n\n\n<p>This is an important difference between using statistics.mean() and the sum() and len() method. The sum() and len() method can be used without importing any libraries. But, you need to import statistics to use statistics.mean().<\/p>\n\n\n\n<p>If you do not mind importing another library, this method works fine. Because you can calculate an average value without any libraries, you should consider doing so before using the statistics library.<\/p>\n\n\n\n<p>We can import the statistics module using a <a href=\"https:\/\/careerkarma.com\/blog\/python-import\/\"><\/a><a href=\"https:\/\/careerkarma.com\/blog\/python-import\/\">Python import statement<\/a>:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>import statistics<\/pre><\/div>\n\n\n\n<p>We can now access the <em>mean()<\/em> function in the statistics library.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">statistics.mean() Example<\/h3>\n\n\n\n<p>Now we\u2019re ready to start calculating averages using <em>mean()<\/em>.<\/p>\n\n\n\n<p>Let\u2019s take the example of coffee orders that we used above. Say we want to calculate the average price of the coffee orders placed so far today. We could use the following code to calculate the average price:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>import statistics\n\norders = [2.50, 4.50, 2.00, 2.75, 2.50, 5.00, 8.00, 2.25]\n\naverage = statistics.mean(orders)\n\nprint(&quot;The average coffee order price today is $&quot; + str(round(average, 2)))<\/pre><\/div>\n\n\n\n<p>Let&#8217;s look at the result of our program:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>The average coffee order price today is $3.69<\/pre><\/div>\n\n\n\n<p>Our program returns the same text and result it did in our first example.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Calculate Average of a Tuple<\/h3>\n\n\n\n<p>We can use the <em>statistics.mean()<\/em> method to calculate the mean value of a tuple, which is an unchangeable, ordered sequence of items. Here\u2019s an example of <em>statistics.mean()<\/em> being used to calculate the average coffee order price, with our information stored in a tuple:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>import statistics\n\norders = (2.50, 4.50, 2.00, 2.75, 2.50, 5.00, 8.00, 2.25)\n\naverage = statistics.mean(orders)\n\nprint(&quot;The average coffee order price today is $&quot; + str(round(average, 2)), &quot;.&quot;)<\/pre><\/div>\n\n\n\n<p>Our code returns the same response as our last example because we&#8217;re working with the same numbers:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>The average coffee order price today is $3.69.<\/pre><\/div>\n\n\n\n<p>A tuple may be used instead of a list if you are working with values that should not change. So, because our coffee order prices will not change after an order has been processed, a tuple is appropriate.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Mean of Negative Values<\/h3>\n\n\n\n<p>You can use <em>mean()<\/em> to calculate the mean value of a set of negative numbers.<\/p>\n\n\n\n<p>Let\u2019s say that we have a list that stores the lowest daily temperatures recorded during a specific week in winter. We could use the following code to calculate the average of that week\u2019s lowest daily temperatures:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>import statistics\n\ntemperatures = [-12, -14, -2, -5, -8, -4, -9]\n\naverage = statistics.mean(temperatures)\n\nprint(&quot;The average of this week's lowest daily temperatures is&quot;, round(average, 2), &quot;degrees Celsius.&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>The average of this week's lowest daily temperatures is -7.71 degrees Celsius.<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>You can calculate the average of a list of values using the sum() and len() methods or the statistics.mean() method. The statistics.mean() method needs to be imported into your program. You can use the sum() and len() method without importing any external libraries into your code.<\/p>\n\n\n\n<p>Do you want to learn more about how to code in Python? Read our <a href=\"https:\/\/careerkarma.com\/blog\/how-to-learn-python\/\">How to Learn Python guide<\/a>. This guide contains a list of top learning resources you can use to advance your knowledge.<\/p>\n","protected":false},"excerpt":{"rendered":"There are two ways to find the average of a list of numbers in Python. You can divide the sum() by the len() of a list of numbers to find the average. Or, you can find the average of a list using the Python mean() function. Finding the average of a set of values is&hellip;","protected":false},"author":240,"featured_media":12851,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[],"class_list":{"0":"post-12850","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 Average: A Step-by-Step Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"Learn how to calculate averages in Python using the \u201clen\u201d and \u201csum\u201d methods, and the statistics module\u2019s \u201cmean\u201d method, on Career Karma.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/python-average\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Average: A Step-by-Step Guide\" \/>\n<meta property=\"og:description\" content=\"Learn how to calculate averages in Python using the \u201clen\u201d and \u201csum\u201d methods, and the statistics module\u2019s \u201cmean\u201d method, on Career Karma.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/python-average\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-20T04:06:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T12:08:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-blur-computer-cup-374897.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=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-average\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-average\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Python Average: A Step-by-Step Guide\",\"datePublished\":\"2021-01-20T04:06:32+00:00\",\"dateModified\":\"2023-12-01T12:08:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-average\/\"},\"wordCount\":1032,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-average\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-blur-computer-cup-374897.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-average\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-average\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/python-average\/\",\"name\":\"Python Average: A Step-by-Step Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-average\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-average\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-blur-computer-cup-374897.jpg\",\"datePublished\":\"2021-01-20T04:06:32+00:00\",\"dateModified\":\"2023-12-01T12:08:50+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"Learn how to calculate averages in Python using the \u201clen\u201d and \u201csum\u201d methods, and the statistics module\u2019s \u201cmean\u201d method, on Career Karma.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-average\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-average\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-average\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-blur-computer-cup-374897.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-blur-computer-cup-374897.jpg\",\"width\":1000,\"height\":667},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-average\/#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 Average: A Step-by-Step Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\",\"url\":\"https:\/\/careerkarma.com\/blog\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/careerkarma.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\",\"name\":\"James Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"caption\":\"James Gallagher\"},\"description\":\"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.\",\"url\":\"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Python Average: A Step-by-Step Guide | Career Karma","description":"Learn how to calculate averages in Python using the \u201clen\u201d and \u201csum\u201d methods, and the statistics module\u2019s \u201cmean\u201d method, on Career Karma.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/careerkarma.com\/blog\/python-average\/","og_locale":"en_US","og_type":"article","og_title":"Python Average: A Step-by-Step Guide","og_description":"Learn how to calculate averages in Python using the \u201clen\u201d and \u201csum\u201d methods, and the statistics module\u2019s \u201cmean\u201d method, on Career Karma.","og_url":"https:\/\/careerkarma.com\/blog\/python-average\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2021-01-20T04:06:32+00:00","article_modified_time":"2023-12-01T12:08:50+00:00","og_image":[{"width":1000,"height":667,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-blur-computer-cup-374897.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":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/python-average\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/python-average\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Python Average: A Step-by-Step Guide","datePublished":"2021-01-20T04:06:32+00:00","dateModified":"2023-12-01T12:08:50+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-average\/"},"wordCount":1032,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-average\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-blur-computer-cup-374897.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/python-average\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/python-average\/","url":"https:\/\/careerkarma.com\/blog\/python-average\/","name":"Python Average: A Step-by-Step Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-average\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-average\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-blur-computer-cup-374897.jpg","datePublished":"2021-01-20T04:06:32+00:00","dateModified":"2023-12-01T12:08:50+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"Learn how to calculate averages in Python using the \u201clen\u201d and \u201csum\u201d methods, and the statistics module\u2019s \u201cmean\u201d method, on Career Karma.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/python-average\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/python-average\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/python-average\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-blur-computer-cup-374897.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-blur-computer-cup-374897.jpg","width":1000,"height":667},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/python-average\/#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 Average: A Step-by-Step Guide"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94","name":"James Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","caption":"James Gallagher"},"description":"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.","url":"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/12850","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=12850"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/12850\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/12851"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=12850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=12850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=12850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}