def min(items):
current = items[0]
index=0
for i,item in enumerate(items):
if items[i] < current: #最大值改这
current = item
index=i
return index
ll = [8,2,1,4]
val = min(ll)
print(val)
最大值改改>就行了 。等同于np.argmin/argmax效果