We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
if__name__=='__main__':nested_list=[]for_inrange(int(input())):name=input()score=float(input())nested_list.append([name,score])unique_sorted_list=sorted(list(set(x[1]forxinnested_list)))second_lowest=unique_sorted_list[1]low_grades_list=[]forstudentinnested_list:ifsecond_lowest==student[1]:low_grades_list.append(student[0])# Print all students with second low grades forstudentinsorted(low_grades_list):print(student)
Nested Lists
You are viewing a single comment's thread. Return to all comments →