title: Python | The median is the middle number in a sorted sequence of numbers
body: <pre><code>def median (lst):
      lst.sort()
      if len(lst) % 2==0:
          print  sum(lst[len(lst)-1:len(lst)])
      else:
          print sum(len(lst)/2)
  
  median([4, 5, 5, 4,2,5,6,9,10])
  </code></pre>
  
  <p>The error occurs at: <code>print sum(len(lst)/2)</code></p>
  
  <pre><code>TypeError: 'int' object is not iterable
  </code></pre>
  
  <p>why doesn't it work?</p>