python sympy symbols code example Example: python sympy symbols >>> x = symbols('x') >>> expr = x + 1 >>> x = 2 >>> print(expr) x + 1