title: Python, getting a centered average with a catch
body: <p>So, my assignment is to get the centered average of a list, much like a few of the other posts on here like this one (<a href="https://codereview.stackexchange.com/questions/108404/how-to-get-a-centered-mean-excluding-max-and-min-value-of-a-list-in-python">https://codereview.stackexchange.com/questions/108404/how-to-get-a-centered-mean-excluding-max-and-min-value-of-a-list-in-python</a>) and a few others. However, my professor has told us we are not allowed to use min, max, or sort to solve this. So what I have right now is this, it is still a work in progress:</p>
  
  <pre><code>def centered_average(nums):
  high=0
  low=0
  a=0
  b=0
  for i in range(len(nums)):
      if nums[i]&gt;a:
          a=nums[i]
          high=a
  for i in range(len(nums)):
      if nums[i]&lt;b:
          b=nums[i]
          low=b     
  total=sum(nums)
  average=(total-high-low)/(len(nums)-2)
  print(average)
  </code></pre>
  
  <p>My problem is that I can't get low to be recognized as the lowest number in the list. For example, if I input [1,2,3,4,5] as the list, my function should return 5 as the high, 1 as the low, and 3 as the centered average since 2+3+4 is 9/3=3. However, what I have right there returns the low as 0. I think it is because of the (lens(nums) since it would think the first number is a 0. I'm not sure how I should fix this.</p>
  
  <p><strong>Note</strong>: I am still a beginner at this stuff so I know what I have might not be the best or that  the error could be simple to fix, but I am still in the process of learning so any help and advice would be much appreciated.</p>