pow()

Anonymous contributor's avatar
Anonymous contributor
Anonymous contributor's avatar
Anonymous contributor
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:

us
Visit us
code
Hide code
Code
Output
Hide output
Hide output
Loading...

Example 2

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

us
Visit us
code
Hide code
Code
Output
Hide output
Hide output
Loading...

All contributors

Looking to contribute?

Learn Python on Codecademy