You are viewing a single comment's thread. Return to all comments →
Readable solution:
if __name__ == '__main__': students=[] for _ in range(int(input())): name = input() score = float(input()) students.append((name,score)) second_lowest=sorted(list(set([x[1] for x in students])))[1] second_students=sorted([s for s,g in students if g==second_lowest]) for s in second_students: print(s)
And not so readable:
if __name__ == '__main__': students=[] for _ in range(int(input())): name = input() score = float(input()) students.append((name,score)) for s in sorted([s for s,g in students if g==sorted(set([x[1] for x in students]))[1]]): print(s)
Seems like cookies are disabled on this browser, please enable them to open this website
Nested Lists
You are viewing a single comment's thread. Return to all comments →
Readable solution:
And not so readable: