发布网友 发布时间:2024-10-21 16:28
共2个回答
热心网友 时间:2024-11-06 23:12
a=[0,2,4,6,5,2]
b=[-7,-6,-2,-10,-5,-11]
def f(a):
return [i for i in range(len(a)) if a[i-1]<a[i] and a[i]>a[i+1] and i!=0 and a!=len(a)-1]
print(f(a))
print(f(b))
热心网友 时间:2024-11-06 23:09