I\'ve tried the following:
>>> from sympy import * >>> a, b, c = symbols(\'a b c\') >>> expression = a & b >>> b = ~a &