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:
- Difference between Method Overloading and Method Overriding in Python
- class method vs static method in Python
- Python | os.dup() method
- Python | next() method
- Python | set() method
- Python | range() method
- Python | cmath.log() method
- Python PIL | Image.new() method
- Python | os.fdatasync() method
- Python | sympy.sec() method
- Python | os.pipe2() method
- Python PIL | getpalette() Method
- Python | os.sendfile() method
- turtle.pos() method in Python
- Python | os.sync() method
- Python | os.rename() method
- Python | sympy.gcd() method
- Python | os.scandir() method
- Python | os.getppid() method
- Python | Tensorflow abs() 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.

