Python | sympy.Mod() method
With the help of sympy.Mod() method, we can find the modulus and can give the parameters separately by using sympy.Mod() method.
Syntax :
sympy.Mod(var1, var2)
Return : Return a value of modulo.
Example #1 :
In this example we can see that by using sympy.Mod() method, we are able to find the modulus for a given parameters.
# import sympy from sympy import * x, y = symbols('x y') # Using sympy.Mod() method gfg = Mod(x, y).subs({x:7, y:2}) print(gfg) |
chevron_right
filter_none
Output :
1
Example #2 :
# import sympy from sympy import * x, y = symbols('x y') # Using sympy.Mod() method gfg = Mod(x**2, y).subs({x:7, y:5}) print(gfg) |
chevron_right
filter_none
Output :
4
Recommended Posts:
- class method vs static method in Python
- Python | set() method
- Python | os.dup() method
- Python | next() method
- Python | Tensorflow sin() method
- Python | os.fsync() method
- Python | os.symlink() method
- Python | os.lchflags() method
- Python | os.mknod() method
- Python | os.sched_get_priority_min() method
- Python | os.sched_setaffinity() method
- Python | os.sched_getaffinity() method
- Python | sympy.det() method
- Python | sympy.div() method
- Python | os.sched_get_priority_max() method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

