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.
marks_sheet=[]
score_list =[]
for _ in range(int(raw_input())):
name = raw_input()
score = float(raw_input())
marks_sheet.append([name,score])
score_list.append(score)
Nested Lists
You are viewing a single comment's thread. Return to all comments →
try this............
marks_sheet=[] score_list =[] for _ in range(int(raw_input())): name = raw_input() score = float(raw_input()) marks_sheet.append([name,score]) score_list.append(score)
second_lowest_mark = sorted(list(dict.fromkeys(score_list)))[1]
for name,marks in sorted(marks_sheet): if marks == second_lowest_mark: print(name)