You are viewing a single comment's thread. Return to all comments →
I have thought like some about how to solve it, but when I try, there are some cases that don't happen to me, does anyone know why?
from operator import itemgetter, attrgetter if __name__ == '__main__': lista1=[] lista3=[] count=0 for _ in range(int(input())): name = input() score = float(input()) lista1.append([name,score]) lista2=sorted(lista1, key=itemgetter(1)) lista3.append(lista2[1][0]) while True: j=1 for i in range(len(lista2)): if i+1==len(lista2): break elif lista2[i][j]==lista2[i+1][j]: lista3.append(lista2[i+1][0]) count+=1 lista3.sort() for z in range(len(lista3)): print(lista3[z]) break
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 →
I have thought like some about how to solve it, but when I try, there are some cases that don't happen to me, does anyone know why?