Built-in Functions
pow()
Raise a number to a power.
pow(base, exp, mod=None)
pow(base, exp) gives the same result as using the ** operator.
A third argument can calculate the result modulo another number.
Parameters
| Name | Description |
|---|---|
| base | The number to raise. |
| exp | The power to use. |
| mod | Optional modulus for a modular power calculation. |
Returns
The calculated number.
Try it
Run it and change it
base = 2 print(pow(base, 3))