python求列表中數字的最大值最小值及下標

python求列表中數字的最大值最小值及下標 a = [2,3,4,5,6,7] max_num = a[0] min_num = a[0] max_index = 0 min_index = 0 for i in range(len(a)): if a[i]>max_num: max_num = a[i] max_index = i else:
相關文章
相關標籤/搜索