title: Finding the middle of a list
body: <p>So I am trying to find the median of the list &quot;revenues&quot; which will be named &quot;base_revenue&quot;.</p>
  <p>Comments:</p>
  <p>#Assume that revenues always has an odd number of members</p>
  <p>#Write code to set base_revenue = midpoint of the revenue list</p>
  <p>#Hint: Use the int and len functions</p>
  <pre><code>revenues = [280.00, 382.50, 500.00, 632.50, 780.00]
  
  
   {def findMiddle(revenues):
      middle = float(len(revenues))/2
  if middle % 2 != 0:
      return revenues[int(middle - .5)]
  else:
      return (revenues[int(middle)], revenues[int(middle-1)])}
  </code></pre>
  <p>I'm getting invalid syntax. The median function itself works, but maybe there is a more efficient way to do it.</p>