Hello I want to find the first index of the max and min value of an array of integer.
my code returns all the index in case of duplicate values ...
A= [1,1,8,7,5,9,6,9]
def minmaxloc(num_list):
for i,y in enumerate(num_list):
if y ==max(num_list) or y==min(num_list):
print i
minmaxloc(A)
output: 0 1 5 7
what i want : (0,5)
thanks for your help.