Python3 多条件排序
n = int(input())
grades = []
for _ in range(n):
s_id, s_grade = input().split()
s_grade = int(s_grade)
if s_grade>=60:
grades.append([s_id,s_grade])
grades = sorted(grades, key=lambda x: (x[1], -int(x[0])), reverse=True)
for i in range(len(grades)):
print(f"{grades[i][0]} {grades[i][1]}")
输入a[i].num的时候,前面有没有&都能ac是为什么?