You are viewing a single comment's thread. Return to all comments →
if __name__ == '__main__': lis=[] for _ in range(int(input())): name = input() score = float(input()) lista = [name,score] lis.append(lista) lis.sort(key=lambda x: x[1],reverse=False) for i in range(0,len(lis)): if lis[i][1]<lis[i+1][1]: val = lis[i+1][1] break new_lis = [] for i in range(0,len(lis)): if lis[i][1] == val: new_lis.append(lis[i]) new_lis.sort(key=lambda x: x[0],reverse=False) for i in range(0,len(new_lis)): print(new_lis[i][0])
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 →