title: Get the span of a list
body: <p>I'm writing a function <code>def span(l)</code> where <code>l</code> is meant to be a list and it returns the range from smallest to largest.</p>
  
  <p>The following is the code:</p>
  
  <pre><code>def span(l):
      l = l.sort()
      smallest = min(l)
      largest = max(l)
      return largest-smallest
  </code></pre>
  
  <p>My problem is that it doesn't recognize that <code>l</code> is a list. That is when I try to return <code>l</code> and I enter the following as input:</p>
  
  <p><code>&gt;&gt;&gt;span([4,2,9,6,9])</code></p>
  
  <p>I keep getting an error.</p>