题解 | #成绩排序#
成绩排序
https://www.nowcoder.com/practice/8e400fd9905747e4acc2aeed7240978b
import sys input_list = [] for line in sys.stdin: a = line.split('\n')[0] input_list.append(a) length = input_list.pop(0) mode = False if input_list.pop(0) == '0': mode = True input_list = sorted(input_list, key=lambda x: int(x.split()[1]), reverse=mode) for i in input_list: print(i)
sorted排序即可