title: A better solution to solve sorting numbers with functions?
body: <p>Im new to python and trying to learn the use of function. I have some numbers i want to sort into low and high's. And want to sort them by calling functions.
  How would you do it?
  Code below :)</p>
  <pre class="lang-py prettyprint-override"><code>rsi_list = ([14, 88, 56, 74, 25, 22, 41, 55, 31, 98, 44, 56, 24, 43, 87, 15, 91, 71, 14, 16, 33, 38, 4, 6, 3, 78])
  
  
  def sort_rsi_low(x):
      low_rsi = []
      for n in rsi_list:
           if n &lt; 50:
              low_rsi.append(n)
      return low_rsi
  
  
  print(sort_rsi_low(rsi_list))
  
  
  def sort_rsi_high(x):
      high_rsi = []
      for n in rsi_list:
          if n &gt; 50:
              high_rsi.append(n)
      return high_rsi
  
  
  print(sort_rsi_high(rsi_list))
  </code></pre>