Compar the list with the names and numbers in the python. Find the name of the highest number
-
On the first list, the names of the players, the number of their points on the second list. We need to find the winner who has the most points, if the two players have the same ring of the highest balls, the winner is the first on the list.
my_list = [['Vasya', 'Sasha', 'Kolya', 'Igor'], [5, 4, 3, 4]] winner = 'Vasya' my_list2= [['Igor', 'Kolya', 'Petya', 'Sasha'], [4, 6, 6, 3]] winner2 = 'Kolya'
-
Like that.
my_list = [['Vasya', 'Sasha', 'Kolya', 'Igor'], [5, 4, 3, 4]] winner = my_list[0][my_list[1].index(max(my_list[1]))] print(winner)
my_list = [['Igor', 'Kolya', 'Petya', 'Sasha'], [4, 6, 6, 3]]
winner = my_list[0][my_list[1].index(max(my_list[1]))]
print(winner)
and, in fact, you should try to make a school assignment.