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':
student = []
for _ in range(int(input())):
name = input()
score = float(input())
student.append([name, score])
marks=[]
for k in student:
marks.append(k[1])
second_highest=sorted(set(marks))[1]
name=[]
for i in student:
if i[1]==second_highest:
name.append(i[0])
for name in sorted(name):
print(name)
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 →
if name == 'main': student = [] for _ in range(int(input())): name = input() score = float(input()) student.append([name, score])