title: Understanding lambda's sort function in python
body: <p>I am trying to sort the list of lists in python. I have written the following code:</p>
  
  <pre><code>def sort(intervals):
      if intervals == [] : return []  
      intervals.sort(key = lambda x:x.start)
      return intervals
  
  a = [[1,3],[8,10],[15,18],[2,6]]
  print(sort(a))
  </code></pre>
  
  <p>I am getting the following error:</p>
  
  <pre><code>AttributeError: 'list' object has no attribute 'start'
  </code></pre>
  
  <p>Please can someone explain lambda function for sort and some details about the above error. Thank you!!        </p>