Sorting a list of tuples with multiple conditions,list_.sort(key=lambda x: x[0])