python查找数组,其某段最大值最小值得位置_python数组最小值与位置-CSDN博客

网站介绍:文章浏览阅读1.7w次。c = [-10,-5,0,5,3,10,15,-20,25]print (c[3:6].index(min(c[3:6]))) # 返回最小值print (c.index(max(c[3:6]))) # 返回最大值In[44]: c = [-10,-5,0,5,3,10,15,-20,25]print (c[3:6].index(min(c[3:6]))) # 返回最小值print ..._python数组最小值与位置