<?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>Sort on SourFox</title>
    <link>https://sourfox.khmersite.net/tags/sort/</link>
    <description>Recent content in Sort on SourFox</description>
    <image>
      <title>SourFox</title>
      <url>https://sourfox.khmersite.net/papermod-cover.png</url>
      <link>https://sourfox.khmersite.net/papermod-cover.png</link>
    </image>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Sat, 10 Feb 2024 19:35:52 +1100</lastBuildDate>
    <atom:link href="https://sourfox.khmersite.net/tags/sort/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Finding the Second Largest Value in a List</title>
      <link>https://sourfox.khmersite.net/p/2024/2/assignment-7/</link>
      <pubDate>Sat, 10 Feb 2024 19:35:52 +1100</pubDate>
      <guid>https://sourfox.khmersite.net/p/2024/2/assignment-7/</guid>
      <description>&lt;p&gt;Halooo! Today I&amp;rsquo;ll be teaching you how to find the second largest value in a list. The conditions -&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Write a Python program that prints the second largest value in a list.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If the list is empty or only has one element, print None.SSS&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To do this, we&amp;rsquo;ll have to make a list and then sort it and then we use the if statement and else.&lt;/p&gt;
&lt;p&gt;Input:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;lista = [1, 4, 8, 9, 100, 200, 30]
lista.sort()

if len(lista) &amp;gt; 1:
    print(lista[-2])
else:
    print(&amp;#34;None&amp;#34;)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Output -&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
