pow()

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...

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn Python on Codecademy

Contributors