input: Write a python function to evaluate a mathematical expression given as a string.
  assert eval_expr("2 + 3 * 4 - 5") == 9
  assert eval_expr("10 / 2 + 3 * 4") == 16.0
  assert eval_expr("(1 + 2) * (3 + 4)") == 21
output: def eval_expr(expression: str) -> float:
      try:
          result = eval(expression)
      except Exception as e:
          raise ValueError(f"Invalid expression: {expression}") from e
      return result