python - sympy: how to sympify logical "NOT" -


the following code work sympify logical expressions:

sympify('a&b') # and(a, b) sympify('a|b') # or(a, b) 

but how result of not(a)?

it turns out symbol looking ~. see following:

>>> sympy import sympify >>> sympify('a&b') and(a, b) >>> sympify('a|b') or(a, b) >>> sympify('~a') not(a) 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -