How to get the second largest number by not usings list and max()min()
<p>I want to find the second largest number such as this topic. <a href="http://stackoverflow.com/questions/16225677/get-the-second-largest-number-in-a-list-in-linear-time">Get the second largest number in a list in linear time</a></p>

<p>My problem is this restricting words <code>list</code>, <code>[]</code>, <code>remove</code>, <code>del</code>, <code>min</code>, <code>max</code>, <code>dict</code>, <code>{}</code>, <code>sort</code>, <code>pop</code>.</p>

<p>I have no ideas to get the second largest number. Then, I want someone to suggest me.</p>

<p>Thanks!</p>

<p>Try this -></p>

<pre><code>a = [1,5,7,8,3,4,6,8,2,9]
x=-999999999999
n=999999999999
for i in a:
    if i&gt;x:
        x=i
for i in a:
    if x-i!=0 and x-i&lt;n:
        n=x-i
        ans=i
print ans
</code></pre>

python