输出一下序列中最大值和最小值以及对应的下标
[34,67,23,89,-45,99,-43,99,-2]
a=[34,67,23,89,-45,99,-43,99,-2]
x=max (a)
y=min (a)
print ("最大值:",x,"对应下标位置:",a.index(x))
print ("最小值:",y,"对应下标位置:",a.index(y))
输出一下序列中最大值和最小值以及对应的下标
[34,67,23,89,-45,99,-43,99,-2]
a=[34,67,23,89,-45,99,-43,99,-2]
x=max (a)
y=min (a)
print ("最大值:",x,"对应下标位置:",a.index(x))
print ("最小值:",y,"对应下标位置:",a.index(y))