>>> from sympy import * >>> x, y = symbols('x,y') >>> y | (x & y) y | (x & y) >>> x | y x | y >>> ~x ~x