c = [-10,-5,0,5,3,10,15,-20,25]
print c.index(min(c)) # 返回最小值
print c.index(max(c)) # 返回最大值
求列表的最大值和最小值及其索引
猜你喜欢
转载自blog.csdn.net/weixin_42528089/article/details/104901986
今日推荐
周排行