my_list=[1,2,4,1]
max_indices = [i for i, value in enumerate(my_list) if value == max(my_list)][0]
print("The indices of all maximum values are:", max_indices)
Get the subscript of the maximum value in a list
Guess you like
Origin blog.csdn.net/qq_38735017/article/details/135236836
Recommended
Ranking