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.
stu_list=[]n=int(input())# Collecting student names and scoresforiinrange(n):name=input()score=float(input())stu_list.append([name,score])# Extracting only the scoresnew_list=[x[1]forxinstu_list]# Finding the second lowest scorem=sorted(set(new_list))#Sortinguniquescores# Sorting names alphabeticallynames=sorted([i[0]foriinstu_listifi[1]==m[1]])# Printing namesfornameinnames:print(name)# Printing namesfornameinnames:print(name)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Nested Lists
You are viewing a single comment's thread. Return to all comments →