Python pow() Function
Definition and Usage
The value of x raised to the power of y (xy) of the pow() function.
If the third parameter is provided, it returns the remainder of x raised to the power of y after taking the modulus z.
Syntax
pow(x, y, z)
Parameter Value
Parameter | Description |
---|---|
x | Number, base. |
y | Number, exponent. |
z | Optional. Number, modulus. |
More Examples
Example
Returns the remainder of 5 raised to the power of 3 modulo 4 (equivalent to (5 * 5 * 5) % 4):
x = pow(5, 3, 4)