{"id":12844,"date":"2020-12-21T19:18:32","date_gmt":"2020-12-22T03:18:32","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=12844"},"modified":"2023-12-01T04:06:19","modified_gmt":"2023-12-01T12:06:19","slug":"python-absolute-value","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/python-absolute-value\/","title":{"rendered":"Python Absolute Value: A Step-By-Step Guide"},"content":{"rendered":"\n<p><em>The Python abs() method returns the absolute value of a number. The absolute value of a number is the number\u2019s distance from 0. This makes any negative number positive, while positive numbers are unaffected. For example, abs(-9) would return 9, while abs(2) would return 2.<\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>An absolute value is the distance between a number and 0 on the number line. These values are useful in a number of mathematical equations. For instance, absolute values are used in distance calculations.<\/p>\n\n\n\n<p>That\u2019s where the <em>abs()<\/em> built-in function comes in. The <em>abs()<\/em> method can be used to calculate the absolute value of a particular number.<\/p>\n\n\n\n<p>In this tutorial, we will discuss how to use the <em>abs()<\/em> method in Python. We will also explore a few examples that illustrate the function in action.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Absolute Value in Python: An Explanation<\/h2>\n\n\n\n<p>In math, an absolute value refers to how far away a number is from zero on the number line. Regardless of whether a number is positive or negative, that number\u2019s absolute value will always be positive.<\/p>\n\n\n\n<p>For example, the absolute value of <em>5<\/em> is <em>5.<\/em> The absolute value of <em>-5<\/em> is also <em>5<\/em>. This is the case because both <em>5<\/em> and <em>-5<\/em> are five spaces away from on the number line. Here\u2019s an example number line to illustrate how this works:<\/p>\n\n\n\n<table class=\"wp-block-table course-info-table\"><tbody><tr><td>-5<\/td><td>-4<\/td><td>-3<\/td><td>-2<\/td><td>-1<\/td><td>0<\/td><td>1<\/td><td>2<\/td><td>3<\/td><td>4<\/td><td>5<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p><em>-5<\/em> is <em>5<\/em> spaces away from zero, and <em>5<\/em> is also <em>5<\/em> spaces away from zero.<\/p>\n\n\n\n<p>Absolute value is an important concept in both mathematics and physics, and it has a wide variety of applications in these fields. Absolute values are also often used in data analysis.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python Absolute Value<\/h2>\n\n\n\n<p>The Python <em>abs()<\/em> method calculates the absolute value of a number. The <em>abs()<\/em> method takes in one parameter: the number whose absolute value you want to calculate.<\/p>\n\n\n\n<p>Here\u2019s the syntax for the <em>abs()<\/em> method:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>abs(value)<\/pre><\/div>\n\n\n\n<p>The abs() method returns either a floating-point number or an integer depending on the value you pass through the method:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>-9 would return 9.<\/li><li>-2.2 would return 2.2.<\/li><\/ul>\n\n\n\n<p>The floating-point value is 2.2, denoted by the period that appears in the number. Because abs() accepts both integers and floating-points, no numerical conversion is necessary to use this method.<\/p>\n\n\n\n<p><em>abs()<\/em> works with zero values and positive numbers (including floating numbers and integers). However, the <em>abs()<\/em> function will return the same value as the value initially parsed through the function. This is positive numbers and zero values are not negative numbers.<\/p>\n\n\n\n<p>Let\u2019s use an example to illustrate how the <em>abs()<\/em> method works.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python abs() Method Example<\/h2>\n\n\n\n<p>Let\u2019s say that you are working for the local police department. They ask you to build an app that calculates whether drivers on a certain road are due for a speeding ticket. On this road, drivers should be going at around the same speed as the average driver.<\/p>\n\n\n\n<p>The police department does not want people exceeding this limit because there was a series of accidents on the road. Many of the accidents were due to excessive speed variability among drivers.<\/p>\n\n\n\n<p>Driving over 10 miles (ca. 16 km) per hour (ca. 16 km\/h) faster or slower than the average driver presents a hazard. Drivers who exceed this limit should receive a ticket.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Evaluating the Speed<\/h3>\n\n\n\n<p>We&#8217;re going to build a program to determine whether a driver should receive a ticket based on their speed:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>average_speed = 50\ncurrent_speed = 38\n\ndifference_between_average_and_current_speed = average_speed - current_speed\n\nabsolute_value = abs(difference_between_average_and_current_speed)\n\nprint(absolute_value)<\/pre><\/div>\n\n\n\n<p>Our code returns: <em>12<\/em>.<\/p>\n\n\n\n<p>On the first line of code, we declared a <a href=\"https:\/\/careerkarma.com\/blog\/python-variables\/\">Python variable<\/a>. This variable stores the average speed of cars on the road, which in this case was 50 mph (ca. 80 km\/h). Then, we declared a variable that stores a specific driver\u2019s current speed\u201438 mph (ca. 61 km\/h) in this case.<\/p>\n\n\n\n<p>On the next line, we calculated the difference between the specific drivers\u2019 current speed and the average speed of cars on the road. Then, we took this value and used the <em>abs()<\/em> method to get the absolute value.<\/p>\n\n\n\n<p>Technically, the difference between the driver\u2019s speed and the average speed is -12 mph (ca. 19 km\/h). But, we only wanted to know the difference between the specific driver\u2019s speed and the average speed of cars on the road. We used abs() to convert our value into an absolute value, and our program returned <em>12<\/em>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Displaying a Message<\/h3>\n\n\n\n<p>We want our program to display a message if a driver is due a ticket. To do this, we can add a <a href=\"https:\/\/careerkarma.com\/blog\/python-if-else\/\">Python if statement<\/a> to the end of our last program&#8221;<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>print(&quot;Speed Difference: &quot; + absolute_value)\n\nif absolute_value &gt; 10:\n\tprint(&quot;This driver is exceeding the speed limit. Write them a ticket.&quot;)\nelse:\n\tprint(&quot;This driver is not exceeding the speed limit.&quot;)<\/pre><\/div>\n\n\n\n<p>First, we print the driver&#8217;s speed difference to the console. Then, we use an if statement to evaluate whether the driver is exceeding the speed limit. A different <a href=\"https:\/\/careerkarma.com\/blog\/python-print-without-new-line\/\">Python print statement<\/a> executes depending on whether the driver exceeds or is driving within the speed limit.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Absolute Value Python: Distance Calculations<\/h2>\n\n\n\n<p>Absolute values are commonly used in distance calculations.<\/p>\n\n\n\n<p>Let\u2019s say that we are trying to travel somewhere 20 miles (ca. 32 km) away from our home. We accidentally travel 31 miles.<\/p>\n\n\n\n<p>If we wanted to know how many miles we have left until we reach our destination, we would end up with a negative number. In order to convert that negative number to a positive one, we could use <em>abs()<\/em>.<\/p>\n\n\n\n<p>Here\u2019s the code for an example that uses the abs() function in Python:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>miles_from_home = 20\ntravelled = 31\n\nmiles_left = miles_from_home - travelled\n\nprint(abs(miles_left))<\/pre><\/div>\n\n\n\n<p>Our code returns: <em>11<\/em>.<\/p>\n\n\n\n<p>If we had not specified <em>abs()<\/em>, our program would have returned <em>-11<\/em> because the difference between 20 and 31 is -11. However, because we used <em>abs()<\/em>, our program returned an absolute value.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The <em>abs()<\/em> method in Python can be used to convert a floating-point number or an integer into an absolute value. This is especially useful when you want to know the difference between two values.<\/p>\n\n\n\n<p>In this tutorial, we explored how to use <em>abs()<\/em> in Python, with reference to two examples.<\/p>\n\n\n\n<p>Do you want to advance your Python knowledge? Check out our complete <a href=\"https:\/\/careerkarma.com\/blog\/how-to-learn-python\/\">How to Learn Python guide<\/a>. In this guide, you&#8217;ll find advice on how to learn Python and a list of top learning resources to look at.<\/p>\n","protected":false},"excerpt":{"rendered":"The Python abs() method returns the absolute value of a number. The absolute value of a number is the number\u2019s distance from 0. This makes any negative number positive, while positive numbers are unaffected. For example, abs(-9) would return 9, while abs(2) would return 2. An absolute value is the distance between a number and&hellip;","protected":false},"author":240,"featured_media":12845,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[],"class_list":{"0":"post-12844","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 Absolute Value: A Step-By-Step Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"Coders can use the abs() method to calculate absolute values in Python. Learn about how abs() works and how they&#039;re useful 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-absolute-value\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Absolute Value: A Step-By-Step Guide\" \/>\n<meta property=\"og:description\" content=\"Coders can use the abs() method to calculate absolute values in Python. Learn about how abs() works and how they&#039;re useful on Career Karma.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/python-absolute-value\/\" \/>\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-12-22T03:18:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T12:06:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-african-american-woman-business-city-1181341.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-absolute-value\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-absolute-value\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Python Absolute Value: A Step-By-Step Guide\",\"datePublished\":\"2020-12-22T03:18:32+00:00\",\"dateModified\":\"2023-12-01T12:06:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-absolute-value\/\"},\"wordCount\":990,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-absolute-value\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-african-american-woman-business-city-1181341.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-absolute-value\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-absolute-value\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/python-absolute-value\/\",\"name\":\"Python Absolute Value: A Step-By-Step Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-absolute-value\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-absolute-value\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-african-american-woman-business-city-1181341.jpg\",\"datePublished\":\"2020-12-22T03:18:32+00:00\",\"dateModified\":\"2023-12-01T12:06:19+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"Coders can use the abs() method to calculate absolute values in Python. Learn about how abs() works and how they're useful on Career Karma.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-absolute-value\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-absolute-value\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-absolute-value\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-african-american-woman-business-city-1181341.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-african-american-woman-business-city-1181341.jpg\",\"width\":1000,\"height\":668,\"caption\":\"A woman in a pink button up uses a laptop while standing in front of computer hardware.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-absolute-value\/#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 Absolute Value: 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 Absolute Value: A Step-By-Step Guide | Career Karma","description":"Coders can use the abs() method to calculate absolute values in Python. Learn about how abs() works and how they're useful 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-absolute-value\/","og_locale":"en_US","og_type":"article","og_title":"Python Absolute Value: A Step-By-Step Guide","og_description":"Coders can use the abs() method to calculate absolute values in Python. Learn about how abs() works and how they're useful on Career Karma.","og_url":"https:\/\/careerkarma.com\/blog\/python-absolute-value\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-12-22T03:18:32+00:00","article_modified_time":"2023-12-01T12:06:19+00:00","og_image":[{"width":1000,"height":668,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-african-american-woman-business-city-1181341.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-absolute-value\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/python-absolute-value\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Python Absolute Value: A Step-By-Step Guide","datePublished":"2020-12-22T03:18:32+00:00","dateModified":"2023-12-01T12:06:19+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-absolute-value\/"},"wordCount":990,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-absolute-value\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-african-american-woman-business-city-1181341.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/python-absolute-value\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/python-absolute-value\/","url":"https:\/\/careerkarma.com\/blog\/python-absolute-value\/","name":"Python Absolute Value: A Step-By-Step Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-absolute-value\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-absolute-value\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-african-american-woman-business-city-1181341.jpg","datePublished":"2020-12-22T03:18:32+00:00","dateModified":"2023-12-01T12:06:19+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"Coders can use the abs() method to calculate absolute values in Python. Learn about how abs() works and how they're useful on Career Karma.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/python-absolute-value\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/python-absolute-value\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/python-absolute-value\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-african-american-woman-business-city-1181341.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/adult-african-american-woman-business-city-1181341.jpg","width":1000,"height":668,"caption":"A woman in a pink button up uses a laptop while standing in front of computer hardware."},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/python-absolute-value\/#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 Absolute Value: 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\/12844","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=12844"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/12844\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/12845"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=12844"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=12844"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=12844"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}