You are viewing a single comment's thread. Return to all comments →
if __name__ == '__main__': nestedlist = [] for _ in range(int(input())): name = input() score = float(input()) nestedlist.append([name, score]) grades = [] for n in range(len(nestedlist)): grades.append(nestedlist[n][1]) unique_grades = set(grades) list_of_unique_grades = list(unique_grades) sorted_unique_grades = sorted(list_of_unique_grades) secondlowest = sorted_unique_grades[1] finalnames = [] for n in range(len(nestedlist)): if nestedlist[n][1] == secondlowest: finalnames.append(nestedlist[n][0]) finalnames_sorted = sorted(finalnames) for n in range(len(finalnames_sorted)): print(finalnames_sorted[n])
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 →