# See https://docs.python.org/3/library/ast.html#ast.literal_eval for more information. print(ast.literal_eval('5*5')) # This will throw ValueError(f'malformed node or string: {node!r}') which is different from eval's behavior