I am trying to sort the list of lists in python. I have written the following 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))
I am getting the following error:
AttributeError: 'list' object has no attribute 'start'
Please can someone explain lambda function for sort and some details about the above error. Thank you!!