{"id":12181,"date":"2020-08-17T17:10:36","date_gmt":"2020-08-18T00:10:36","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=12181"},"modified":"2023-12-01T03:58:00","modified_gmt":"2023-12-01T11:58:00","slug":"python-reverse-list","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/python-reverse-list\/","title":{"rendered":"Python Reverse List: A Step-by-Step Tutorial"},"content":{"rendered":"\n<p><em>You can reverse a list in Python using the built-in <\/em><code><em>reverse()<\/em><\/code><em> or <\/em><code><em>reversed()<\/em><\/code><em> methods. These methods will reverse the list without creating a new list. Python <\/em><code><em>reverse()<\/em><\/code><em> and <\/em><code><em>reversed()<\/em><\/code><em> will reverse the elements in the original list object.<\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>Reversing a list is a common part of any programming language. In this tutorial, we are going to break down the most effective Python reverse list methods.<\/p>\n\n\n\n<p>Let\u2019s say you have a <a href=\"https:\/\/careerkarma.com\/blog\/python-list-methods\/\">list in Python<\/a> of customer names in reverse alphabetical order but want to see them in alphabetical order. You would have to reverse the list to do so. If you have a long list and want to see what&#8217;s at the bottom, you could just scroll down. Or, you could reverse to get the data quickly.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_81 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<label for=\"ez-toc-cssicon-toggle-item-69db17137566f\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #000000;color:#000000\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #000000;color:#000000\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69db17137566f\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/careerkarma.com\/blog\/python-reverse-list\/#python-lists-and-list-slicing-a-refresher\" >Python Lists and List Slicing: A Refresher<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/careerkarma.com\/blog\/python-reverse-list\/#list-slicing\" >List Slicing<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/careerkarma.com\/blog\/python-reverse-list\/#python-reverse-list-tutorial\" >Python Reverse List Tutorial<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/careerkarma.com\/blog\/python-reverse-list\/#reverse-using-slicing\" >Reverse Using Slicing<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/careerkarma.com\/blog\/python-reverse-list\/#reverse-using-reverse\" >Reverse Using Reverse()<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/careerkarma.com\/blog\/python-reverse-list\/#reverse-using-reversed\" >Reverse Using Reversed()<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/careerkarma.com\/blog\/python-reverse-list\/#conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"python-lists-and-list-slicing-a-refresher\"><\/span>Python Lists and List Slicing: A Refresher<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In Python, lists are <a href=\"https:\/\/careerkarma.com\/blog\/python-array\/\">arrays of items<\/a>. Your list could include strings, booleans, numbers, objects, or any other data type in Python, and can hold as many as you want. When working with a lot of data, it can be useful to declare a list instead of declaring multiple variables.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"list-slicing\"><\/span>List Slicing<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>While you don\u2019t need to know about list slicing to perform a reverse list operation, it can be helpful.<\/p>\n\n\n\n<p>This is how you would <a href=\"https:\/\/careerkarma.com\/blog\/how-to-initialize-a-list-in-python\/\">declare a list in Python<\/a>:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>studentNames = [&quot;Hannah&quot;, &quot;Imogen&quot;, &quot;Lewis&quot;, &quot;Peter&quot;]<\/pre><\/div>\n\n\n\n<p>We have just declared a variable, <code>studentNames<\/code>, and assigned a list of values\u2014in this case, the names of students\u2014to the variable.&nbsp;<\/p>\n\n\n\n<p>If we want to get a particular value from our list, we can use its index numbers and slice the list. That\u2019s a lot to take in, so let\u2019s break it down. Each item in our list has an <a href=\"https:\/\/careerkarma.com\/blog\/python-index\/\">index value<\/a>, starting from 0. We can use them to get a certain value from our list. Here are the index values for our array:<\/p>\n\n\n\n<table class=\"wp-block-table course-info-table\"><tbody><tr><td>Hannah<\/td><td>Imogen<\/td><td>Lewis<\/td><td>Peter<\/td><\/tr><tr><td>0<\/td><td>1<\/td><td>2<\/td><td>3<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p><\/p>\n\n\n\n<p>If we want to get <code>Imogen<\/code> from our list, we would do so using the following code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>studentNames = [&quot;Hannah&quot;, &quot;Imogen&quot;, &quot;Lewis&quot;, &quot;Peter&quot;]\nprint(studentNames[1])<\/pre><\/div>\n\n\n\n<p>We have declared our variable with student names. Next, we said we want to get the list item with the index value of <code>1<\/code>. In this case, the value was <code>Imogen<\/code>.<\/p>\n\n\n\n<p>We can also change the index number to get a range by adding another one. Here\u2019s an example: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>studentNames = [&quot;Hannah&quot;, &quot;Imogen&quot;, &quot;Lewis&quot;, &quot;Peter&quot;]\nprint(studentNames[1:3])<\/pre><\/div>\n\n\n\n<p>The output for our code would be as follows: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>[&quot;Imogen&quot;, &quot;Lewis&quot;, &quot;Peter&quot;]<\/pre><\/div>\n\n\n\n<p>Now we know the basics of list slicing, we can start to discuss reversing lists in Python.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"python-reverse-list-tutorial\"><\/span>Python Reverse List Tutorial<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The three main ways that you can reverse a list in Python are: <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Reverse using slicing <\/strong><\/li><li><strong>Reverse using Reverse()<\/strong><\/li><li><strong>Reverse using Reversed <\/strong><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"reverse-using-slicing\"><\/span>Reverse Using Slicing<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The first is to use a slicing trick to reverse your list. Here is the Python syntax:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>studentNames = [&quot;Hannah&quot;, &quot;Imogen&quot;, &quot;Lewis&quot;, &quot;Peter&quot;]\nprint(studentNames[::-1])<\/pre><\/div>\n\n\n\n<p>The output for our code is: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>[&quot;Peter&quot;, &quot;Lewis&quot;, &quot;Imogen&quot;, &quot;Hannah&quot;]<\/pre><\/div>\n\n\n\n<p>In our code, we have declared our variable <code>studentNames<\/code>, and then created a slice function that will reverse the list. This is a common way to slice lists. But it can be inefficient because it <a href=\"https:\/\/careerkarma.com\/blog\/python-copy-list\/\">creates a copy of the list<\/a>, which takes up memory. In addition, this function can be a little advanced in relation to other methods of reversing lists.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"reverse-using-reverse\"><\/span>Reverse Using Reverse()<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The second option we can take is to use the built-in function, <code>reverse()<\/code>. The <code>reverse()<\/code> method can be called to reverse the contents of a list object in-place. This means you won\u2019t be creating a new list. Instead, we will modify the original list object. <\/p>\n\n\n\n<p>The following code shows the Python syntax for <code>reverse()<\/code> in action:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>studentNames = [&quot;Hannah&quot;, &quot;Imogen&quot;, &quot;Lewis&quot;, &quot;Peter&quot;]\nstudentNames.reverse()\n\nprint(studentNames)<\/pre><\/div>\n\n\n\n<p>The output for our code is as follows: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>[&quot;Peter&quot;, &quot;Lewis&quot;, &quot;Imogen&quot;, &quot;Hannah&quot;]<\/pre><\/div>\n\n\n\n<p>It\u2019s important to note that the <code>reverse()<\/code> function itself returns a value of <code>None<\/code>. So, if we want to get our revised list, we need to print it out again, as we did above. This is an efficient way of reversing a list and does not require a lot of memory, unlike our example. The syntax is also clear and simple.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"reverse-using-reversed\"><\/span>Reverse Using Reversed()<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The third and final approach we can use to reverse a list is to use the <code>reversed()<\/code> function. This is a built-in function we use by <a href=\"https:\/\/careerkarma.com\/blog\/python-reverse-string\/\">creating a reverse iterator<\/a> to create a reverse order of our list in Python. This means that a new list isn\u2019t created, and our old list is not modified. Instead, the function will cycle through all of the elements in our list and return them in reverse order.<\/p>\n\n\n\n<p>The following syntax shows the <code>reversed()<\/code> function in action:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>studentNames = [&quot;Hannah&quot;, &quot;Imogen&quot;, &quot;Lewis&quot;, &quot;Peter&quot;]\nfor i in reversed(studentNames):\n\tprint(i)<\/pre><\/div>\n\n\n\n<p>The output for our code is:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>&quot;Peter&quot;\n&quot;Lewis&quot;\n&quot;Imogen&quot;\n&quot;Hannah&quot;<\/pre><\/div>\n\n\n\n<p>If we really wanted to create a reversed copy of the list, we could use this code: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>studentNames = [&quot;Hannah&quot;, &quot;Imogen&quot;, &quot;Lewis&quot;, &quot;Peter&quot;]\nlist(reversed(studentNames))<\/pre><\/div>\n\n\n\n<p>This would return: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>[&quot;Peter&quot;, &quot;Lewis&quot;, &quot;Imogen&quot;, &quot;Hannah&quot;]<\/pre><\/div>\n\n\n\n<p>This is another easy way to reverse lists. It clearly shows what is going on. A new list is being created that will include all the values in our other list, but reversed.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>That\u2019s how the various reverse list methods work. In this tutorial, we have explored the basics of lists, which are arrays of items such as strings or objects, and discussed index values. We have also outlined three methods you can use to reverse a list.<\/p>\n\n\n\n<p>Of course, you only need to know one. But being aware of all three may help you if others have different approaches and use them in code you read.\n<\/p>\n","protected":false},"excerpt":{"rendered":"You can reverse a list in Python using the built-in reverse() or reversed() methods. These methods will reverse the list without creating a new list. Python reverse() and reversed() will reverse the elements in the original list object. Reversing a list is a common part of any programming language. In this tutorial, we are going&hellip;","protected":false},"author":240,"featured_media":15122,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[],"class_list":{"0":"post-12181","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 Reverse List: A Step-by-Step Tutorial | Career Karma<\/title>\n<meta name=\"description\" content=\"Reversing a list is important for programmers: it allows you to get list values in reverse order. Learn more with 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-reverse-list\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Reverse List: A Step-by-Step Tutorial\" \/>\n<meta property=\"og:description\" content=\"Reversing a list is important for programmers: it allows you to get list values in reverse order. Learn more with Career Karma.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/python-reverse-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-08-18T00:10:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T11:58:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/python-reverse-list.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"560\" \/>\n\t<meta property=\"og:image:height\" content=\"315\" \/>\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-reverse-list\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-reverse-list\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Python Reverse List: A Step-by-Step Tutorial\",\"datePublished\":\"2020-08-18T00:10:36+00:00\",\"dateModified\":\"2023-12-01T11:58:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-reverse-list\/\"},\"wordCount\":860,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-reverse-list\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/python-reverse-list.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-reverse-list\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-reverse-list\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/python-reverse-list\/\",\"name\":\"Python Reverse List: A Step-by-Step Tutorial | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-reverse-list\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-reverse-list\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/python-reverse-list.jpg\",\"datePublished\":\"2020-08-18T00:10:36+00:00\",\"dateModified\":\"2023-12-01T11:58:00+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"Reversing a list is important for programmers: it allows you to get list values in reverse order. Learn more with Career Karma.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-reverse-list\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-reverse-list\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-reverse-list\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/python-reverse-list.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/python-reverse-list.jpg\",\"width\":560,\"height\":315,\"caption\":\"Python reverse list cover image\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-reverse-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\":\"Python Reverse List: A Step-by-Step Tutorial\"}]},{\"@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 Reverse List: A Step-by-Step Tutorial | Career Karma","description":"Reversing a list is important for programmers: it allows you to get list values in reverse order. Learn more with 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-reverse-list\/","og_locale":"en_US","og_type":"article","og_title":"Python Reverse List: A Step-by-Step Tutorial","og_description":"Reversing a list is important for programmers: it allows you to get list values in reverse order. Learn more with Career Karma.","og_url":"https:\/\/careerkarma.com\/blog\/python-reverse-list\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-08-18T00:10:36+00:00","article_modified_time":"2023-12-01T11:58:00+00:00","og_image":[{"width":560,"height":315,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/python-reverse-list.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-reverse-list\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/python-reverse-list\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Python Reverse List: A Step-by-Step Tutorial","datePublished":"2020-08-18T00:10:36+00:00","dateModified":"2023-12-01T11:58:00+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-reverse-list\/"},"wordCount":860,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-reverse-list\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/python-reverse-list.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/python-reverse-list\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/python-reverse-list\/","url":"https:\/\/careerkarma.com\/blog\/python-reverse-list\/","name":"Python Reverse List: A Step-by-Step Tutorial | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-reverse-list\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-reverse-list\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/python-reverse-list.jpg","datePublished":"2020-08-18T00:10:36+00:00","dateModified":"2023-12-01T11:58:00+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"Reversing a list is important for programmers: it allows you to get list values in reverse order. Learn more with Career Karma.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/python-reverse-list\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/python-reverse-list\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/python-reverse-list\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/python-reverse-list.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/python-reverse-list.jpg","width":560,"height":315,"caption":"Python reverse list cover image"},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/python-reverse-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":"Python Reverse List: A Step-by-Step Tutorial"}]},{"@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\/12181","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=12181"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/12181\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/15122"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=12181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=12181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=12181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}