{"id":12787,"date":"2021-01-04T14:54:34","date_gmt":"2021-01-04T22:54:34","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=12787"},"modified":"2023-12-01T04:06:27","modified_gmt":"2023-12-01T12:06:27","slug":"python-copy-list","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/python-copy-list\/","title":{"rendered":"How to Copy a List in Python"},"content":{"rendered":"\n<p><em>You can copy a list in Python using the copy() method, slicing, the list() method, and a list comprehension. The copy() method is the most direct way of copying a Python list.<\/em><\/p>\n\n\n\n<p>When you\u2019re working with a list in Python, you may encounter a situation where you want to create a copy of that list.<\/p>\n\n\n\n<p>For instance, you may be creating a program that, using last year\u2019s student roster, generates an updated roster for the new school year. This program should preserve the old class roster.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-how-to-copy-a-list-in-python\">How to Copy a List in Python<\/h2>\n\n\n\n<p>There are four methods you can use to copy a list in Python:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Using the slicing syntax<\/li><li>Using the copy() method<\/li><li>Using the list() method<\/li><li>Declaring a list comprehension<\/li><\/ul>\n\n\n\n<p>This tutorial will discuss, using examples, how to employ <em>copy()<\/em>, <em>slicing<\/em>, <em>list comprehension<\/em>, and <em>list()<\/em> to create a copy of a list in Python.<\/p>\n\n\n\n<p>You can use the equals sign to create a copy of a list. But, the new list will be linked to the old one. This means that if you change the new list the old one will be changed too. The new list refers to the same object as the old list.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-copy-list-python-copy-method\">Copy List Python: copy() Method<\/h2>\n\n\n\n<p>The Python copy() method creates a copy of an existing list. The copy() method is added to the end of a list object and so it does not accept any parameters. copy() returns a new list.<\/p>\n\n\n\n<p>Python includes a built-in function to support creating a shallow copy of a list: <em>copy()<\/em>. You can use the <em>copy()<\/em> method to replicate a list and leave the original list unchanged.<\/p>\n\n\n\n<p>The <em>copy()<\/em> method takes in no parameters. You add it to the end of a list name. Here\u2019s the syntax for creating a new object Python <em>copy()<\/em> method:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>new_list = old_list.copy()<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-python-copy-method-example\">Python copy() Method Example<\/h3>\n\n\n\n<p>Let\u2019s walk through an example to show how you can use the <em>copy()<\/em> method. Say that we operate a fruit stand and are looking to update our product list to reflect the new fruits in season for summer.<\/p>\n\n\n\n<p>To do so, we want to create a new list of products based on the old one. We want to save our old one for later use. This will allow us to keep track of what products we sold last season in an old list. We&#8217;ll also be able to keep track of what we are selling this season in a new list.<\/p>\n\n\n\n<p>We can use the <em>copy()<\/em> method to duplicate a list and accomplish this task. Here\u2019s an example of using <em>copy()<\/em> to create a copy of our list of fruit product offerings:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>spring_fruits = ['Apricot', 'Avocado', 'Kiwi', 'Grapefruit', 'Cherry', 'Strawberry']\n\nsummer_fruits = spring_fruits.copy()\n\nprint(summer_fruits)<\/pre><\/div>\n\n\n\n<p>Here\u2019s the result of our program:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>['Apricot', 'Avocado', 'Kiwi', 'Grapefruit', 'Cherry', 'Strawberry']<\/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> called <em>spring_fruits<\/em>. This variable keeps track of the fruits we sold in spring.<\/p>\n\n\n\n<p>Then, we use the <em>copy()<\/em> method to create a new list called <em>summer_fruits<\/em> which contains all the items in the <em>spring_fruits<\/em> array. Finally, we print the <em>summer_fruits<\/em> array to the console. As you can see, our <em>summer_fruits<\/em> list contains the same values as our original list\u2014the <em>spring_fruits<\/em> list.<\/p>\n\n\n\n<p>Now that we have a copy of our list, we can modify it to reflect our new fruit offerings. We can do so using the <em>append()<\/em> and <em>remove()<\/em> methods.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-copy-list-python-slicing\">Copy List Python: Slicing<\/h2>\n\n\n\n<p>Slicing is a technique in Python that you can use to retrieve items from a list. Using the slicing technique, you can retrieve individual items, multiple items, or all items stored within a list. If you\u2019re interested in learning more about slicing, read our <a href=\"https:\/\/careerkarma.com\/blog\/python-list-methods\">guide to Python list methods<\/a>.<\/p>\n\n\n\n<p>Let\u2019s use the example above to show how we can use slicing to copy a list. Say that we are operating a fruit stand. We want to create a new list for summer products that contains all the spring products that we sold. We could do so using slice cloning.<\/p>\n\n\n\n<p>Here\u2019s the code we would use to create a copy of our list using slice cloning:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>spring_fruits = ['Apricot', 'Avocado', 'Kiwi', 'Grapefruit', 'Cherry', 'Strawberry']\n\nsummer_fruits = spring_fruits[:]\n\nprint(summer_fruits)<\/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>['Apricot', 'Avocado', 'Kiwi', 'Grapefruit', 'Cherry', 'Strawberry']<\/pre><\/div>\n\n\n\n<p>Our code is similar to the example we used above to demonstrate the <em>copy()<\/em> method. The difference is that, rather than using <em>copy()<\/em>, we use Python\u2019s cloning notation.<\/p>\n\n\n\n<p>The cloning notation is a colon enclosed within square brackets ([:]), as you can see in the example above. This method creates a copy of the old list.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-python-copy-list-list-method\">Python Copy List: list() Method<\/h2>\n\n\n\n<p>You can also use the <em>list()<\/em> function to create a <em>copy<\/em> of a list in Python. The <em>list()<\/em> method of copying takes in one parameter: the object(s) you want to convert into a list. Here\u2019s the syntax for the <em>list()<\/em> method:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>list(list_name)<\/pre><\/div>\n\n\n\n<p>Let\u2019s use our fruit stand example to illustrate this method in action. Here\u2019s an example of using <em>list()<\/em> to create a list of summer fruits based on our list of spring fruits:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>spring_fruits = ['Apricot', 'Avocado', 'Kiwi', 'Grapefruit', 'Cherry', 'Strawberry']\n\nsummer_fruits = list(spring_fruits)\n\nprint(summer_fruits)<\/pre><\/div>\n\n\n\n<p>Our code returns the following new list:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>['Apricot', 'Avocado', 'Kiwi', 'Grapefruit', 'Cherry', 'Strawberry']<\/pre><\/div>\n\n\n\n<p>As you can see, assigning <em>list(spring_fruits)<\/em> to <em>summer_fruits<\/em> in our code created a copy of the <em>spring_fruits<\/em> list and saved it as <em>summer_fruits<\/em>. We then printed our new list to the console using the <em>print()<\/em> function.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-python-copy-list-list-comprehension\">Python Copy List: List Comprehension<\/h2>\n\n\n\n<p>You can concisely create lists using the <a href=\"https:\/\/careerkarma.com\/blog\/python-list-comprehension\/\">Python list comprehension method<\/a>. This method uses a <em>for\u2026in<\/em> expression.<\/p>\n\n\n\n<p>List comprehension works by iterating through all items in an existing list using a <em>for<\/em> loop and populating a new list with those items.<\/p>\n\n\n\n<p>Here\u2019s the syntax for list comprehension in Python:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>new_list = [i for i in old_list]<\/pre><\/div>\n\n\n\n<p>We can use our fruit stand example to illustrate this method in action. Here\u2019s an example of using list comprehension to create a new list of summer fruits based on our list of spring fruits:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>spring_fruits = ['Apricot', 'Avocado', 'Kiwi', 'Grapefruit', 'Cherry', 'Strawberry']\n\nsummer_fruits = [i for i in spring_fruits]\n\nprint(summer_fruits)<\/pre><\/div>\n\n\n\n<p>Our code uses list comprehension to create a new list, called <em>summer_fruits<\/em>, and returns the following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>['Apricot', 'Avocado', 'Kiwi', 'Grapefruit', 'Cherry', 'Strawberry']<\/pre><\/div>\n\n\n\n<p>As you can see, our program has created a <em>summer_fruits<\/em> list that contains all the values that are in our original <em>spring_fruits<\/em> list.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n\n\n\n<p>This tutorial looked at four approaches that you can use to create a copy of a list in Python. We discussed how to use the <em>copy()<\/em> method, the slice cloning technique, the <em>list()<\/em> function, and the list comprehension method.<\/p>\n\n\n\n<p>You\u2019re now equipped with the knowledge you need to create a copy of a list in Python! If you&#8217;re looking for learning resources or courses to help you learn Python, check out 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 copy a list in Python using the copy() method, slicing, the list() method, and a list comprehension. The copy() method is the most direct way of copying a Python list. When you\u2019re working with a list in Python, you may encounter a situation where you want to create a copy of that list.&hellip;","protected":false},"author":240,"featured_media":12788,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[],"class_list":{"0":"post-12787","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>How to Copy a List in Python: A Complete Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"Python offers coders four main methods of copying a list. Learn how to copy a list in Python using these approaches 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-copy-list\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Copy a List in Python\" \/>\n<meta property=\"og:description\" content=\"Python offers coders four main methods of copying a list. Learn how to copy a list in Python using these approaches on Career Karma.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/python-copy-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=\"2021-01-04T22:54:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T12:06:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-sitting-in-front-of-keyboard-2422278.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"749\" \/>\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-copy-list\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-copy-list\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"How to Copy a List in Python\",\"datePublished\":\"2021-01-04T22:54:34+00:00\",\"dateModified\":\"2023-12-01T12:06:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-copy-list\/\"},\"wordCount\":1088,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-copy-list\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-sitting-in-front-of-keyboard-2422278.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-copy-list\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-copy-list\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/python-copy-list\/\",\"name\":\"How to Copy a List in Python: A Complete Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-copy-list\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-copy-list\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-sitting-in-front-of-keyboard-2422278.jpg\",\"datePublished\":\"2021-01-04T22:54:34+00:00\",\"dateModified\":\"2023-12-01T12:06:27+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"Python offers coders four main methods of copying a list. Learn how to copy a list in Python using these approaches on Career Karma.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-copy-list\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-copy-list\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-copy-list\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-sitting-in-front-of-keyboard-2422278.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-sitting-in-front-of-keyboard-2422278.jpg\",\"width\":1000,\"height\":749},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-copy-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 Copy 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\/#\/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":"How to Copy a List in Python: A Complete Guide | Career Karma","description":"Python offers coders four main methods of copying a list. Learn how to copy a list in Python using these approaches 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-copy-list\/","og_locale":"en_US","og_type":"article","og_title":"How to Copy a List in Python","og_description":"Python offers coders four main methods of copying a list. Learn how to copy a list in Python using these approaches on Career Karma.","og_url":"https:\/\/careerkarma.com\/blog\/python-copy-list\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2021-01-04T22:54:34+00:00","article_modified_time":"2023-12-01T12:06:27+00:00","og_image":[{"width":1000,"height":749,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-sitting-in-front-of-keyboard-2422278.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-copy-list\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/python-copy-list\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"How to Copy a List in Python","datePublished":"2021-01-04T22:54:34+00:00","dateModified":"2023-12-01T12:06:27+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-copy-list\/"},"wordCount":1088,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-copy-list\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-sitting-in-front-of-keyboard-2422278.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/python-copy-list\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/python-copy-list\/","url":"https:\/\/careerkarma.com\/blog\/python-copy-list\/","name":"How to Copy a List in Python: A Complete Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-copy-list\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-copy-list\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-sitting-in-front-of-keyboard-2422278.jpg","datePublished":"2021-01-04T22:54:34+00:00","dateModified":"2023-12-01T12:06:27+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"Python offers coders four main methods of copying a list. Learn how to copy a list in Python using these approaches on Career Karma.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/python-copy-list\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/python-copy-list\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/python-copy-list\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-sitting-in-front-of-keyboard-2422278.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/man-sitting-in-front-of-keyboard-2422278.jpg","width":1000,"height":749},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/python-copy-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 Copy 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\/#\/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\/12787","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=12787"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/12787\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/12788"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=12787"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=12787"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=12787"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}