{"id":12833,"date":"2020-05-18T18:03:45","date_gmt":"2020-05-19T01:03:45","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=12833"},"modified":"2023-12-01T02:47:27","modified_gmt":"2023-12-01T10:47:27","slug":"python-isinstance","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/python-isinstance\/","title":{"rendered":"Python isinstance: A Step-By-Step Guide"},"content":{"rendered":"\n<p><em>The <\/em><code><em>isinstance()<\/em><\/code><em> function in Python returns true or false if a variable matches a specified data type. The syntax for <\/em><code><em>isinstance()<\/em><\/code><em> in Python is <\/em><code><em>isinstance(variable_to_check, data_type)<\/em><\/code><em>.<\/em><\/p>\n\n\n\n<p>Checking the data type of a particular value is a common operation in programming. For example, you may want to check whether the value you stored in a variable is a string or a number since each of these data types works differently in code.<\/p>\n\n\n\n<p>That\u2019s where the <code>isinstance()<\/code> function can be useful. <code>isinstance()<\/code> is a built-in Python method that allows you to verify a particular value\u2019s data type. For example, you can use <code>isinstance()<\/code> to check if a value is a string or a list.<\/p>\n\n\n\n<p>This tutorial will walk you through how to use the <code>isinstance()<\/code> method in Python and will provide a few examples to help you better understand it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python isinstance Overview<\/h2>\n\n\n\n<p>When you code in Python, you use various types of data. These data types include strings, numbers, lists, tuples, and dictionaries. Every data type has its own set of rules that governs how that data is stored and manipulated. For example, when using Python, you can perform mathematical calculations on numbers but not on strings. <\/p>\n\n\n\n<p>As a result, it\u2019s important that you are working with the right data types in your program. You can use isinstance in Python to verify that the data you are working with is stored as the appropriate data type. When using Python, check data types as needed.<\/p>\n\n\n\n<p><code>isinstance()<\/code> is a function built into Python that checks whether a value is stored as a particular data type. Unlike the <code>type()<\/code> method, which is discussed later in this article, the <code>isinstance()<\/code> method returns only <code>True<\/code> or <code>False<\/code>, depending on whether the value you are checking is stored as the data type or types you specify.<\/p>\n\n\n\n<p>The syntax for <code>isinstance()<\/code> is as follows:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>isinstance(object, data_types)<\/pre><\/div>\n\n\n\n<p>The <code>isinstance()<\/code> method takes in two parameters, both of which are required:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>object<\/strong>: the object whose data type you want to check.<\/li>\n\n\n\n<li><strong>data_types<\/strong>: at least one of the possible data types of the object.&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>The <code>isinstance()<\/code> method then compares the object against the data type(s) you specified. If you want to compare the object against two or more data types, you\u2019ll need to specify a tuple as the data_types parameter.<\/p>\n\n\n\n<p>In response, your code returns <code>True<\/code> or <code>False<\/code>. The code returns <code>True<\/code> if the object belongs to the data type (or one of the data types) you specify, and <code>False<\/code> if not.<\/p>\n\n\n\n<p>Essentially, when you use isinstance in Python, you are presenting your code with a fill-in-the-blank statement and at least one answer choice. Your statement is: <code>This object is a (data type)<\/code>. Specifying the data type parameter completes that statement. Two examples are:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>12<\/code> is a number.<\/li>\n\n\n\n<li><code>books<\/code> is a number.<\/li>\n<\/ul>\n\n\n\n<p>In response, your code returns <code>True<\/code> or <code>False<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python isinstance Examples<\/h2>\n\n\n\n<p>Let\u2019s run through two examples to show how you can use the <code>isinstance()<\/code> method in your code. Say that we have a value, and we want to verify that the value is a string. We could use <code>isinstance()<\/code> to do this. Here\u2019s the code we could use:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>print(isinstance(\"String\", str))<\/pre><\/div>\n\n\n\n<p>Our code performs a type check and then our function returns: <code>True<\/code>.&nbsp;<\/p>\n\n\n\n<p>Because <code>String<\/code> is actually a string (<code>str<\/code> is how you refer to the data type <code>string<\/code> in Python) our program returns <code>True<\/code>.<\/p>\n\n\n\n<p>Now we\u2019ll explore a more detailed example.<\/p>\n\n\n\n<p>Let\u2019s say that we are building a multiplication game for a second-grade class. Our game presents a user with a math problem, and then it checks the user\u2019s answer to see whether they are correct. In order for our program to work, we need to make sure that the user has entered a number into our game.<\/p>\n\n\n\n<p>To check if the answer we collected from the player is a number, we could use this code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>answer = 5 * 8\nuser_answer = input(\"What is 5 x 8?\")\nprint(isinstance(user_answer, (int, float)))<\/pre><\/div>\n\n\n\n<p>Our code returns: <code>False<\/code>.<\/p>\n\n\n\n<p>Let\u2019s break down our program. On the first line, we calculate the answer to the math problem that we presented to the player. In this case, that math problem was: <code>What is 5 x 8?<\/code>, so we input <code>answer = 5 * 8<\/code> for the first line of our code.&nbsp;<\/p>\n\n\n\n<p>Then, we use the <code>input()<\/code> method to retrieve an answer from the user.<\/p>\n\n\n\n<p>On the final line of our code, we use <code>isinstance()<\/code> to check whether our user\u2019s answer (stored in <code>user_answer<\/code>) is either an integer or a float, which are the two data types used to represent numbers in Python. We do this by creating a tuple that stores the data types against which we want to check our value. In our code, this tuple is: <code>(int, float)<\/code>.<\/p>\n\n\n\n<p>Our code returns <code>False<\/code>, which tells us that the user\u2019s answer is neither an integer (int) nor a float.&nbsp;<\/p>\n\n\n\n<p>Now that we know that our object is not an instance of int or float, we can start to diagnose the problem. Our code returns <code>False<\/code> because <code>input()<\/code> gives us a string by default, even if a user enters a number. So, for our code to work, we need to convert the result of our <code>input()<\/code> method into an integer. We can do so using the following code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>answer = 5 * 8\nuser_answer = int(input(\"What is 5 x 8?\"))\nprint(isinstance(user_answer, (int, float)))<\/pre><\/div>\n\n\n\n<p>Now when we run our code, we get: <code>True<\/code>.&nbsp;<\/p>\n\n\n\n<p>The only difference between this example and the previous one is that, in this code, on the <code>user_answer<\/code> line, we convert the result of our <code>input()<\/code> method to an integer by using <code>int()<\/code>. Therefore, the program registers the input as an integer rather than a string. So, when we check this value\u2019s data type using the <code>isinstance()<\/code> method, our program verifies that the value is either an integer or a float.<\/p>\n\n\n\n<p>In the above example, we checked whether an object held a particular built-in data type. The <code>isinstance()<\/code> method can also be used to compare an object with a specific class.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">type vs. isinstance<\/h2>\n\n\n\n<p>If you\u2019ve ever needed to check the type of a value in Python, you may have come across the <code>type()<\/code> method. <code>type()<\/code> is a built-in Python function that can be used to find out the type of a variable or value. Here\u2019s the syntax for the Python type method:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>type(data)<\/pre><\/div>\n\n\n\n<p>For example, let\u2019s say you have a number and you want to check to see what data type it is coded as. You could do so using the following code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>number = 8\nprint(type(number))<\/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>&lt;class 'int'&gt;<\/pre><\/div>\n\n\n\n<p>As you can see, our program returns the type of our data. It tells us that this data is stored as an integer.<\/p>\n\n\n\n<p>There is one big difference between the <code>type()<\/code> and <code>isinstance()<\/code> functions that makes one more appropriate to use than another in certain circumstances. If you want to see a value\u2019s data type, <code>type()<\/code> may be more appropriate. But, if you want to verify that a value is stored as a <em>certain<\/em> data type or types\u2014such as a string or a float\u2014you should use <code>isinstance()<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>In Python, you can use the <code>isinstance()<\/code> function to verify whether a value holds a particular data type. For example, if you want to verify that a list of values is stored as a list, or if a number is stored as a float, you can use <code>isinstance()<\/code>.<\/p>\n\n\n\n<p>This Python tutorial demonstrated how to use <code>isinstance()<\/code> to verify whether a value holds a certain data type. Now you have the information you need to use <code>isinstance()<\/code> like a Python master.<\/p>\n","protected":false},"excerpt":{"rendered":"The isinstance() function in Python returns true or false if a variable matches a specified data type. The syntax for isinstance() in Python is isinstance(variable_to_check, data_type). Checking the data type of a particular value is a common operation in programming. For example, you may want to check whether the value you stored in a variable&hellip;","protected":false},"author":240,"featured_media":12834,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[],"class_list":{"0":"post-12833","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":"","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 isinstance: A Step-By-Step Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"Checking a value\u2019s data type is a common operation in coding. On Career Karma, learn how to use the Python \u201cisinstance\u201d function to verify the data type of a certain value.\" \/>\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-isinstance\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python isinstance: A Step-By-Step Guide\" \/>\n<meta property=\"og:description\" content=\"Checking a value\u2019s data type is a common operation in coding. On Career Karma, learn how to use the Python \u201cisinstance\u201d function to verify the data type of a certain value.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/python-isinstance\/\" \/>\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-05-19T01:03:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T10:47:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/working-woman-technology-computer-7374.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-isinstance\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-isinstance\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Python isinstance: A Step-By-Step Guide\",\"datePublished\":\"2020-05-19T01:03:45+00:00\",\"dateModified\":\"2023-12-01T10:47:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-isinstance\/\"},\"wordCount\":1175,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-isinstance\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/working-woman-technology-computer-7374.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-isinstance\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-isinstance\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/python-isinstance\/\",\"name\":\"Python isinstance: A Step-By-Step Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-isinstance\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-isinstance\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/working-woman-technology-computer-7374.jpg\",\"datePublished\":\"2020-05-19T01:03:45+00:00\",\"dateModified\":\"2023-12-01T10:47:27+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"Checking a value\u2019s data type is a common operation in coding. On Career Karma, learn how to use the Python \u201cisinstance\u201d function to verify the data type of a certain value.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-isinstance\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-isinstance\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-isinstance\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/working-woman-technology-computer-7374.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/working-woman-technology-computer-7374.jpg\",\"width\":1000,\"height\":667},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-isinstance\/#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 isinstance: 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 isinstance: A Step-By-Step Guide | Career Karma","description":"Checking a value\u2019s data type is a common operation in coding. On Career Karma, learn how to use the Python \u201cisinstance\u201d function to verify the data type of a certain value.","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-isinstance\/","og_locale":"en_US","og_type":"article","og_title":"Python isinstance: A Step-By-Step Guide","og_description":"Checking a value\u2019s data type is a common operation in coding. On Career Karma, learn how to use the Python \u201cisinstance\u201d function to verify the data type of a certain value.","og_url":"https:\/\/careerkarma.com\/blog\/python-isinstance\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-05-19T01:03:45+00:00","article_modified_time":"2023-12-01T10:47:27+00:00","og_image":[{"width":1000,"height":667,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/working-woman-technology-computer-7374.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-isinstance\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/python-isinstance\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Python isinstance: A Step-By-Step Guide","datePublished":"2020-05-19T01:03:45+00:00","dateModified":"2023-12-01T10:47:27+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-isinstance\/"},"wordCount":1175,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-isinstance\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/working-woman-technology-computer-7374.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/python-isinstance\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/python-isinstance\/","url":"https:\/\/careerkarma.com\/blog\/python-isinstance\/","name":"Python isinstance: A Step-By-Step Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-isinstance\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-isinstance\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/working-woman-technology-computer-7374.jpg","datePublished":"2020-05-19T01:03:45+00:00","dateModified":"2023-12-01T10:47:27+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"Checking a value\u2019s data type is a common operation in coding. On Career Karma, learn how to use the Python \u201cisinstance\u201d function to verify the data type of a certain value.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/python-isinstance\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/python-isinstance\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/python-isinstance\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/working-woman-technology-computer-7374.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/working-woman-technology-computer-7374.jpg","width":1000,"height":667},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/python-isinstance\/#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 isinstance: 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\/12833","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=12833"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/12833\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/12834"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=12833"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=12833"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=12833"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}