title: how to find index of min and max value of a int array Python
body: <p>Hello I want to find the first index of the max and min value of an array of integer.</p>
  
  <p>my code returns all the index in case of duplicate values ...</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>output: 
  0
  1
  5
  7</p>
  
  <p>what i want : 
  (0,5)</p>
  
  <p>thanks for your help.</p>