ID EN
Built-in Functions

pow

Python 3.11

Return base to the power exp; if mod is present, return base to the power exp, modulo mod (computed more efficiently than pow(base, exp) % mod). The two-argument form pow(base, exp) is equivalent to using the power operator: base**exp.

Syntax

PYTHON
pow(base, exp, mod=None)

Examples

Example 1
PYTHON
>>> pow(38, -1, mod=97)
23
>>> 23 * 38 % 97 == 1
True

See Also

int int float int int