题解 | #成绩排序#
成绩排序
http://www.nowcoder.com/practice/8e400fd9905747e4acc2aeed7240978b
转成int排序准没错
n = int(input().strip()) m = int(input().strip()) a = [] for i in range(n): li = input().strip().split() a.append(li) if m == 0: for i in sorted(a,key=lambda x:(-int(x[1]))): print(i[0],i[1]) else : for i in sorted(a,key=lambda x:int(x[1])): print(i[0],i[1])