pow()

christian.dinh's avatar
Published May 10, 2021Updated Sep 3, 2021
Contribute to Docs

Returns the value of a base number x to the power of an exponent y, with an optional modulus z.

Syntax

pow(x, y, z)

Example 1

Use pow() to return the result of 5 to the power of 3:

Code
Output
Loading...

Example 2

Use pow() to return the result of 5 to the power of 3 with a modulus of 3:

Code
Output
Loading...

All contributors

Contribute to Docs

Learn Python on Codecademy