{"id":12747,"date":"2020-11-23T09:03:52","date_gmt":"2020-11-23T17:03:52","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=12747"},"modified":"2023-12-01T04:04:52","modified_gmt":"2023-12-01T12:04:52","slug":"python-remove-duplicates-from-list","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/python-remove-duplicates-from-list\/","title":{"rendered":"How to Remove Duplicates from a List in Python"},"content":{"rendered":"\n<p><em>You can remove duplicates from a Python using the dict.fromkeys(), which generates a dictionary that removes any duplicate values. You can also convert a list to a set. You must convert the dictionary or set back into a list to see a list whose duplicates have been removed.<\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>When you\u2019re working with a list in Python, there may be a scenario where you want to remove duplicates from the list. For example, say you are a chef who is merging the old and new menus for your restaurant. You may want to remove any duplicates that occur from combining the two menus.<\/p>\n\n\n\n<p>This tutorial will cover using the <em>dict.fromkeys()<\/em> method converting a list to a set. We&#8217;ll discuss how to convert the output from these two methods back into a list so you can interpret your data as a list.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python Remove Duplicates From a List<\/h2>\n\n\n\n<p>You can remove duplicates using a Python set or the dict.fromkeys() method.<\/p>\n\n\n\n<p>The dict.fromkeys() method converts a list into a dictionary. Dictionaries cannot contain duplicate values so a dictionary with only unique values is returned by dict.fromkeys().<\/p>\n\n\n\n<p>Sets, like dictionaries, cannot contain duplicate values. If we convert a list to a set, all the duplicates are removed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python Remove Duplicates from List: dict.fromkeys()<\/h2>\n\n\n\n<p><a href=\"https:\/\/careerkarma.com\/blog\/python-dictionary\/\">Python dictionaries<\/a> store data in a key\/value structure. Dictionaries map keys to values and create a pair that stores data in Python.<\/p>\n\n\n\n<p>Dictionaries in Python cannot include duplicate keys. If we convert our list to a dictionary, it will remove any duplicate values. That\u2019s where the <em>fromkeys()<\/em> method comes in.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">dict.fromkeys() Example<\/h3>\n\n\n\n<p><em>fromkeys()<\/em> is a built-in function that generates a dictionary from the keys you have specified. Because dictionaries cannot include duplicate keys, the function will remove any duplicate values from our list. Then, we can convert our dictionary back to a list.<\/p>\n\n\n\n<p>The syntax for the <em>fromkeys()<\/em> method is as follows:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>dictionary_name.fromkeys(keys, value)<\/pre><\/div>\n\n\n\n<p><em>fromkeys<\/em> takes two parameters: keys and value. The keys parameter is the iterable, which specifies the keys of the new dictionary you want to create. Our value parameter is optional and holds the value for all keys. We do not need this parameter for this example, so we will ignore it.<\/p>\n\n\n\n<p>Let\u2019s say that we are a chef who is merging the old and new pizza menus into one big menu. The new menu includes a number of new pizzas that we have been working on for months. But, we want to offer the pizzas on the old menu. We do not want duplicates to appear on the menu, because that would confuse customers.<\/p>\n\n\n\n<p>To remove any duplicates that may exist in the new menu, we could use the following code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>new_menu = ['Hawaiian', 'Margherita', 'Mushroom', 'Prosciutto', 'Meat Feast', 'Hawaiian', 'Bacon', 'Black Olive Special', 'Sausage', 'Sausage']\n\nfinal_new_menu = list(dict.fromkeys(new_menu))\n\nprint(final_new_menu)<\/pre><\/div>\n\n\n\n<p>Our code removes our duplicated elements and returns: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>['Hawaiian', 'Margherita', 'Mushroom', 'Prosciutto', 'Meat Feast', 'Bacon', 'Black Olive Special', 'Sausage']<\/pre><\/div>\n\n\n\n<p>On the first line, we declare a <a href=\"https:\/\/careerkarma.com\/blog\/python-variables\/\">Python variable<\/a> called <em>new_menu<\/em> which stores all the pizzas on the new menu. Note that this list contains duplicate values \u2014 both <em>Sausage<\/em> and <em>Hawaiian<\/em> appear twice in the Python lists.<\/p>\n\n\n\n<p>We use the <em>dict.fromkeys()<\/em> method to create a dictionary from our <em>new_menu<\/em> variable. Next, we use <em>list()<\/em> to convert our data from a dictionary to a <a href=\"https:\/\/careerkarma.com\/blog\/python-array\/\">Python array<\/a>, or list. On the final line of code, we print out our revised list.<\/p>\n\n\n\n<p>As you can see, our program has removed the duplicate values from our data, and <em>Sausage<\/em> and <em>Hawaiian<\/em> appear once in our new list.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Remove Duplicates from List Python: Sets<\/h2>\n\n\n\n<p>The <a href=\"https:\/\/careerkarma.com\/blog\/python-sets\/\">Python set object<\/a> is a data structure that is both <em>unordered<\/em> and <em>unindexed<\/em>. Sets store collections of unique items in Python. Unlike lists, sets cannot store duplicate values.<\/p>\n\n\n\n<p>So, because sets cannot store duplicate items, we can convert our list to a set to remove them. In Python, sets are a list of comma-separated items enclosed within curly brackets. Here\u2019s an example of a set in Python that stores a list of pizzas:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>pizzas = ('Margherita', 'Hawaiian', 'Mushroom', 'Meat Feast')<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Remove Duplicates Using a Set Example<\/h3>\n\n\n\n<p>Let\u2019s take our example from above to illustrate how sets can be used to remove duplicate values from a list.<\/p>\n\n\n\n<p>Say that we are a pizza chef who wants to merge both our old and new menus. But there may be duplicates between these menus, which we will want to remove before creating our final menu. To remove these duplicates using the set approach, we could use the following code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>new_menu = ['Hawaiian', 'Margherita', 'Mushroom', 'Prosciutto', 'Meat Feast', 'Hawaiian', 'Bacon', 'Black Olive Special', 'Sausage', 'Sausage']\n\nfinal_new_menu = list(set(new_menu))\n\nprint(final_new_menu)<\/pre><\/div>\n\n\n\n<p>Here\u2019s our list after removing duplicate values:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>['Mushroom', 'Black Olive Special', 'Meat Feast', 'Bacon', 'Margherita', 'Sausage', 'Prosciutto', 'Hawaiian']<\/pre><\/div>\n\n\n\n<p>At the start of our program, we declare a list called <em>new_menu<\/em> which stores all the pizzas on the new menu.<\/p>\n\n\n\n<p>Then, we declare a variable called <em>final_new_menu<\/em> which stores our revised menu. This variable converts the <em>new_menu<\/em> variable to a set using <em>set()<\/em>, then converts the set back to a list using <em>list()<\/em>. This process removes all the duplicate values in our <em>new_menu<\/em> variable.<\/p>\n\n\n\n<p>Finally, our program prints the new menu to the console. All the unique elements from the original list object appear. We now have a unique list.<\/p>\n\n\n\n<iframe loading=\"lazy\" src=\"https:\/\/repl.it\/@careerkarma\/How-to-Remove-Duplicates-from-a-List-in-Python?lite=true\" width=\"100%\" height=\"400px\" frameborder=\"0\"><\/iframe>\n<br>\n<br>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Removing duplicate items from a list is a common operation in Python. There is no official method that should be used to remove duplicates from a list. The most common approaches are to use the dictionary <em>fromkeys()<\/em> function or convert your data into a set.<\/p>\n\n\n\n<p>In this guide, we discussed how to use the dictionary <em>fromkeys()<\/em> function and sets to remove duplicates from a list in Python.<\/p>\n\n\n\n<p>To learn more about Python programming, read our <a href=\"https:\/\/careerkarma.com\/blog\/how-to-learn-python\/\">How to Learn Python guide<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"You can remove duplicates from a Python using the dict.fromkeys(), which generates a dictionary that removes any duplicate values. You can also convert a list to a set. You must convert the dictionary or set back into a list to see a list whose duplicates have been removed. When you\u2019re working with a list in&hellip;","protected":false},"author":240,"featured_media":12748,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[],"class_list":{"0":"post-12747","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.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Remove Duplicates from a List in Python | Career Karma<\/title>\n<meta name=\"description\" content=\"Removing duplicates from a list is a common operation in Python. Learn how to remove duplicates from a list 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-remove-duplicates-from-list\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Remove Duplicates from a List in Python\" \/>\n<meta property=\"og:description\" content=\"Removing duplicates from a list is a common operation in Python. Learn how to remove duplicates from a list on Career Karma.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/python-remove-duplicates-from-list\/\" \/>\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-11-23T17:03:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T12:04:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-REMOVE-DUPLICATE.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-remove-duplicates-from-list\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-remove-duplicates-from-list\\\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"How to Remove Duplicates from a List in Python\",\"datePublished\":\"2020-11-23T17:03:52+00:00\",\"dateModified\":\"2023-12-01T12:04:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-remove-duplicates-from-list\\\/\"},\"wordCount\":920,\"commentCount\":1,\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-remove-duplicates-from-list\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/PYTHON-REMOVE-DUPLICATE.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-remove-duplicates-from-list\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-remove-duplicates-from-list\\\/\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-remove-duplicates-from-list\\\/\",\"name\":\"How to Remove Duplicates from a List in Python | Career Karma\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-remove-duplicates-from-list\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-remove-duplicates-from-list\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/PYTHON-REMOVE-DUPLICATE.jpg\",\"datePublished\":\"2020-11-23T17:03:52+00:00\",\"dateModified\":\"2023-12-01T12:04:52+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"Removing duplicates from a list is a common operation in Python. Learn how to remove duplicates from a list on Career Karma.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-remove-duplicates-from-list\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-remove-duplicates-from-list\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-remove-duplicates-from-list\\\/#primaryimage\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/PYTHON-REMOVE-DUPLICATE.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/PYTHON-REMOVE-DUPLICATE.jpg\",\"width\":1000,\"height\":667},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/python-remove-duplicates-from-list\\\/#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\":\"How to Remove Duplicates from a List in Python\"}]},{\"@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\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/james-gallagher-150x150.jpg\",\"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":"How to Remove Duplicates from a List in Python | Career Karma","description":"Removing duplicates from a list is a common operation in Python. Learn how to remove duplicates from a list 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-remove-duplicates-from-list\/","og_locale":"en_US","og_type":"article","og_title":"How to Remove Duplicates from a List in Python","og_description":"Removing duplicates from a list is a common operation in Python. Learn how to remove duplicates from a list on Career Karma.","og_url":"https:\/\/careerkarma.com\/blog\/python-remove-duplicates-from-list\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-11-23T17:03:52+00:00","article_modified_time":"2023-12-01T12:04:52+00:00","og_image":[{"width":1000,"height":667,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-REMOVE-DUPLICATE.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-remove-duplicates-from-list\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/python-remove-duplicates-from-list\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"How to Remove Duplicates from a List in Python","datePublished":"2020-11-23T17:03:52+00:00","dateModified":"2023-12-01T12:04:52+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-remove-duplicates-from-list\/"},"wordCount":920,"commentCount":1,"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-remove-duplicates-from-list\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-REMOVE-DUPLICATE.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/python-remove-duplicates-from-list\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/python-remove-duplicates-from-list\/","url":"https:\/\/careerkarma.com\/blog\/python-remove-duplicates-from-list\/","name":"How to Remove Duplicates from a List in Python | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-remove-duplicates-from-list\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-remove-duplicates-from-list\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-REMOVE-DUPLICATE.jpg","datePublished":"2020-11-23T17:03:52+00:00","dateModified":"2023-12-01T12:04:52+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"Removing duplicates from a list is a common operation in Python. Learn how to remove duplicates from a list on Career Karma.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/python-remove-duplicates-from-list\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/python-remove-duplicates-from-list\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/python-remove-duplicates-from-list\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-REMOVE-DUPLICATE.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/PYTHON-REMOVE-DUPLICATE.jpg","width":1000,"height":667},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/python-remove-duplicates-from-list\/#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":"How to Remove Duplicates from a List in Python"}]},{"@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\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","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\/12747","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=12747"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/12747\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/12748"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=12747"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=12747"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=12747"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}