Open In App

Python | sympy.divmod() method

Improve
Improve
Like Article
Like
Save
Share
Report

With the help of sympy.divmod() method, we can find the modulus and quotient of the given values.

 Syntax: sympy.divmod(val1, val2)

 Return: (quotient, modulo)

Example #1 :




# import sympy 
from sympy import *
  
# Using sympy.divmod() method 
gfg = divmod(Integer(48), Integer(7))
  
print(gfg)


Output:

(6, 6)

Example #2 :




# import sympy 
from sympy import *
  
# Using sympy.divmod() method 
gfg = divmod(48.2, Integer(7))
  
print(gfg)


Output:

(6, 6.2)

Last Updated : 26 Aug, 2019
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads