You are viewing a single comment's thread. Return to all comments →
if __name__ == '__main__': student_score = [] for _ in range(int(input())): name = input() score = float(input()) student_score.append([name, score]) grades = [score for _, score in student_score] unique_grade = list(set(grades)) unique_grade.sort() if len(unique_grade) > 1: second_lowest_grade = unique_grade[1] seconders = [] for student in student_score: if student[1] == second_lowest_grade: seconders.append(student[0]) seconders.sort() for student in seconders: print (student) else: print('No second lowest')
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 →