To substitute several values:
>>> from sympy import Symbol
>>> x, y = Symbol('x y')
>>> f = x + y
>>> f.subs({x:10, y: 20})
>>> f
30
More Related Contents:
- Is it possible to plot implicit equations using Matplotlib?
- How to solve a pair of nonlinear equations using Python?
- how to handle an asymptote/discontinuity with Matplotlib
- How to extract all coefficients in sympy
- Sympy – Comparing expressions
- Evaluate sympy expression from an array of values
- What causes this error (AttributeError: ‘Mul’ object has no attribute ‘cos’) in Python?
- How do I use the markers parameter of a sympy plot?
- Prevent Sympy from rearranging the equation
- Get all positive integral solutions for a linear equation
- Is it possible to plot implicit equations?
- Using Sympy Equations for Plotting
- Does Python have a ternary conditional operator?
- Best way to return multiple values from a function? [closed]
- Is there a decorator to simply cache function return values?
- What are type hints in Python 3.5?
- How to add placeholder to an Entry in tkinter?
- What is the return value of os.system() in Python?
- Python C program subprocess hangs at “for line in iter”
- Detecting Mouse clicks in windows using python
- How to run Pip commands from CMD
- Python – why use “self” in a class?
- printing a two dimensional array in python
- UnicodeDecodeError: ‘utf8’ codec can’t decode bytes in position 3-6: invalid data
- Why do numbers in a string become “x0n” when a backslash precedes them?
- Default value in Python unpacking
- TypeError: Object of type ‘bytes’ is not JSON serializable
- Loop over 2 lists, repeating the shortest until end of longest [duplicate]
- How to find linearly independent rows from a matrix
- Why do you need to create a cursor when querying a sqlite database?