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.
for name, score in sort:
if score > lowest:
sec_low = score
break
name_lst = [name for name, score in sort if score == sec_low]
for n in sorted(name_lst):
print(n)
if name == 'main':
listt = []
for _ in range(int(input())):
name = input()
score = float(input())
listt.append([name, score])
second_lowest(listt)
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 →
def second_lowest(lst): sort = sorted(lst, key=lambda x: x[1]) lowest = sort[0][1] sec_low = None
if name == 'main': listt = [] for _ in range(int(input())): name = input() score = float(input()) listt.append([name, score])