keep a list `dataList` of lists sorted as it is created by second element,dataList.sort(key=lambda x: x[1])