I am looking to find the lowest positive value in an array and its position in the list. If a value within the list is duplicated, only the FIRST instance is of interest. This is what I have which does what I want but includes 0.
print "Position:", myArray.index(min(myArray))
print "Value:", min(myArray)
for example, as it stands if,
myArray = [4, 8, 0, 1, 5]
then Position: 2, Value: 0
I want it to present position: 3, value: 1
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…