Home >>Python math Module >Python math.remainder() Method

Python math.remainder() Method

Python math.remainder() Method

Python math.remainder() method in python is used to returns the remainder of the first number with respect to the second number in the float of given numbers and , it accepts two numbers (integer or float).

Syntax:
math.remainder(x, y)

Parameter Values

Parameter Description
x It is required a number you want to divide.
y It is required a number you want to divide with.
Here is an Example of Python math.remainder() Method:

import math
print (math.remainder(5, 1))
print (math.remainder(14, 10))

Output:
0.0
4.0
Example 2:

import math
x = 12
y = 5
print(math.remainder(x,y))
x = 12.4
y = 5.7
print(math.remainder(x,y))

Output:
2.0
1.0