Python pow() Function
The pow() function returns the value of x to the power of y
(xy).
If a third parameter is present, it returns x to the power of y, modulus z.
Syntax
pow(x, y, z)
Parameters
| Parameter | Description |
|---|---|
x |
Required. A number, the base |
y |
Required. A number, the exponent |
z |
Optional. A number, the modulus |
Return Value
A number (float or integer) representing the power.
Example
Using the pow() function:
Output
Click Run to execute your code
Enjoying these tutorials?