title: How to substitute multiple symbols in an expression in sympy?
body: <p>Assigning a variable directly does not modify expressions that used the variable retroactively.</p>
  
  <pre><code>&gt;&gt;&gt; from sympy import Symbol
  &gt;&gt;&gt; x = Symbol('x')
  &gt;&gt;&gt; y = Symbol('y')
  &gt;&gt;&gt; f = x + y
  &gt;&gt;&gt; x = 0
  
  &gt;&gt;&gt; f
  x + y
  </code></pre>