python基础之取列表中最大值的索引值

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python基础之取列表中最大值的索引值相关的知识,希望对你有一定的参考价值。

‘‘‘ 取列表中最大值的索引值 www.pythontutor.com ‘‘‘ list_group = [5,90,59,132,54] max_index = 0 list_index = 0 for num in list_group: if num > list_group[max_index]: max_index = list_index list_index += 1 print(max_index)

以上是关于python基础之取列表中最大值的索引值的主要内容,如果未能解决你的问题,请参考以下文章