def eval_product(parse_result):
 prod = 1.0
 current_op = operator.mul
 for token in parse_result:
  if (token == '*'):
   current_op = operator.mul
  elif (token == '/'):
   current_op = operator.truediv
  else:
   prod = current_op(prod, token)
 return prod

def eval_product ( parse_result ) : prod = 1.0 current_op = operator . mul for token in parse_result : if ( token == '*' ) : current_op = operator . mul elif ( token == '/' ) : current_op = operator . truediv else : prod = current_op ( prod , token ) return prod
multiply the inputs .