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__':N=int(input())records=[]scores=[]if2<=N<=5:for_inrange(N):name=input()score=float(input())records.append([name,score])scores.append(score)else:print("Invalid!")#remove duplicates, sort them and get the second lowest valuesecond_lowest_score=sorted(set(scores))[1]#extractnamesofstudentswhohavethesecondlowestscoresecond_lowest_name=[nameforname,scoreinrecordsifscore==second_lowest_score]second_lowest_name.sort()print(*second_lowest_name,sep="\n")#unpacking
Cookie support is required to access HackerRank
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 →