How to sort list by parameter in python?
You can use lambda function to pass argument by which you need to sort the records.

For example,

sorted_list=sorted(emp_records, key=lambda emp : emp[1])   //Here 1 means ID    
print(sorted_list)


You can also use the operator module. The operator module has the itemgetter function, which takes item as argument and sort based on the argument

For example,

from operator import itemgetter    
sorted_list=sorted(emp_records, key=itemgetter(1)) // Here 1 means ID    
print(sorted_list)