Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

literal_eval in python

# 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
 
PREVIOUS NEXT
Tagged: #python
ADD COMMENT
Topic
Name
1+4 =