title: Minimum and maximum sums from a list Python
body: <p>I've been doing problems on HackerRank to get my foot in the door for solving Python problems and while I've had fun working through a few, one problem is stumping me.</p>
  
  <p>This problem is the Mini-Max sum, which takes an input(<strong>arr</strong>); an array of <strong>5 integers</strong>, and prints the sum of the biggest and smallest 4 integers from arr in the next line's format via <strong>miniMaxSum(arr)</strong></p>
  
  <p>maximum minimum</p>
  
  <p>e.g. miniMaxSum(1, 2, 3, 4, 5)</p>
  
  <p>10 14</p>
  
  <p>I've done something which you can find below that works with this, and <strong>most examples</strong> to return the desired results, but I've just found out that it doesn't work for arr = (5, 5, 5, 5, 5). I suspect that this is because when the maximum value is identical to another value in the list (e.g. arr = 1, 2, 3, 4, 4) or likewise for minimum (e.g. arr = 1, 1, 3, 4, 5), my code simply fails as it <strong>relies on nothing being the same as arr's biggest or smallest value</strong>. The HackerRank error message is "<strong>Wrong Answer</strong>" if that helps.</p>
  
  <p>Please <strong>critique and suggest improvements</strong> so it works with <strong>any</strong> array of 5 integers (e.g. (5, 5, 5, 5, 5)). I am keen in understanding how this works and your help would be immensely appreciated. Thanks in advance!</p>
  
  <pre><code># Complete the miniMaxSum function below.
  def miniMaxSum(arr):
      listmax = []
      listmin = []
      for number in arr:
          if number &gt; min(arr):
              listmax.append(number)    
      for number in arr:
          if number &lt; max(arr):
              listmin.append(number)
      maxnum = sum(listmax)
      minnum = sum(listmin)
      print (minnum, maxnum)
  </code></pre>