首发于每天学点python 切换模式写文章 登录/注册python寻找list中最大值、最小值并返回其所在位置 隐月映影 记录自己的点滴13 人赞同了该文章 举例如下: c = [-10,-5,0,5,3,10,15,-20,25] print (c.index(min(c))) # 返回最小值 print (c.index(max(c))) # 返回最大值 但是,如果存在...
python寻找list中最大值、最小值并返回其所在位置的方法 python寻找list中最⼤值、最⼩值并返回其所在位置的⽅ 法 实例如下所⽰:c = [-10,-5,0,5,3,10,15,-20,25]print c.index(min(c)) # 返回最⼩值 print c.index(max(c)) # 返回最⼤值 以上这篇python寻找list中最⼤值、最⼩...
c = [-10,-5,0,5,3,10,15,-20,25] print c.index(min(c)) # 返回最小值 print c.index(max(c)) # 返回最大值
c = [-10,-5,0,5,3,10,15,-20,25] print (min(c)) # 返回最小值 print (max(c)) # 返回最大值 原文地址:/