The function evaluates a given string as a Python expression and returns the result.
