PSEUDO CODE & Python for finding the greatest, second greatest, and least number
<p>I am a student and for a task I have to write code for a task in both python and pseudocode. The task has been done but I don't really like ending lines of code which compares variables to find the greatest, 2nd greatest and least value. I am using if statements but was wondering if there was a better way to do this. I know of the sort function, and that can be used in case of python but what about pseudocode.</p>

<p>To see the code: Lines[72:92] <a href="http://pastebin.com/MTnifkek" rel="nofollow">http://pastebin.com/MTnifkek</a></p>

<p>To see the python code: <a href="http://pastebin.com/fvqqstXW" rel="nofollow">http://pastebin.com/fvqqstXW</a></p>

<p>In python it's the same but instead I use nested ifs.
As you may notice, this was my first time, and apologies on any errors.
I tried think but other than nesting ifs I was blank.
I was thinking a for loop:</p>

<pre><code>for count in charity_value:
if count &gt; max:
max == count
elif count &lt; min:
min == count
</code></pre>

<p>Though how would I find the middle value ?</p>

<p>Thats how you do it in pseudocode. Just watch out for the <code>==</code> and <code>=</code>. It's not the same, the first one is for equality testing and the other is assignment.</p>

<p>In python you might want to use <code>max(charity_value)</code> as well as <code>min(charity_value)</code></p>

python pseudocode