def indexOf(a, b):
 for (i, j) in enumerate(a):
  if (j == b):
   return i
 else:
  raise ValueError('sequence.index(x): x not in sequence')

def indexOf ( a , b ) : for ( i , j ) in enumerate ( a ) : if ( j == b ) : return i else : raise ValueError ( 'sequence.index(x): x not in sequence' )
return the first index of b in a .