<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Reversed on Script Everything</title>
    <link>https://scripteverything.com/tags/reversed/</link>
    <description>Recent content in Reversed on Script Everything</description>
    <generator>Hugo -- 0.146.0</generator>
    <language>en-au</language>
    <lastBuildDate>Fri, 09 Jun 2023 07:12:02 +0000</lastBuildDate>
    <atom:link href="https://scripteverything.com/tags/reversed/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>List Comprehension In Reverse Order With Python</title>
      <link>https://scripteverything.com/list-comprehension-reverse-order/</link>
      <pubDate>Fri, 09 Jun 2023 07:12:02 +0000</pubDate>
      <guid>https://scripteverything.com/list-comprehension-reverse-order/</guid>
      <description>&lt;p&gt;How do you perform a list comprehension in reverse using Python?&lt;/p&gt;
&lt;p&gt;A list comprehension is generally a short one line code that allows you to create a new list by iterating through an iterator (such as another list).&lt;/p&gt;
&lt;p&gt;The syntax for a list comprehension is &lt;code&gt;[expression for variable in iterable if condition]&lt;/code&gt; with the &lt;code&gt;if condition&lt;/code&gt; part being optional.&lt;/p&gt;
&lt;p&gt;The easiest way to perform a reverse iteration is to use the &lt;code&gt;reversed()&lt;/code&gt; function on the &lt;code&gt;iterable&lt;/code&gt; so that the list comprehension syntax is written as: &lt;code&gt;[expression for variable in reversed(iterable)]&lt;/code&gt; .&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
