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.
l1=[]
n=int(input())
for i in range(n):
name = input()
score = float(input())
score2 = f"{score:.2f}"
l=[]
l.append(name)
l.append(score2)
l1.append(l)
l3=[]
for i in range(n):
l3.append(l1[i][1])
l3.sort()
l4=[]
for i in range(n):
if(l3[2]==l1[i][1]):
s=l1[i][0]
l4.append(s)
l4.sort()
for i in l4:
print(i)
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 →
l1=[] n=int(input()) for i in range(n): name = input() score = float(input()) score2 = f"{score:.2f}" l=[] l.append(name) l.append(score2) l1.append(l) l3=[] for i in range(n): l3.append(l1[i][1]) l3.sort() l4=[] for i in range(n): if(l3[2]==l1[i][1]): s=l1[i][0] l4.append(s) l4.sort() for i in l4: print(i)