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

apache - setting document root in antoher partition on ubuntu -

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

Process 'command 'F:\android-sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 1 -