Operator Functions

operator.pow()

Raise a base to a power. Only two operands; use built-in pow for modular exponentiation. Equivalent to a ** b; custom operand types control the result.

Formal Syntax & Structure

python syntaxpython
operator.pow(a, b, /)

Parameters & Attributes

NameTypeDescription
aobjectLeft operand or target object.
bobjectRight operand.

Return Value

object

The object result described above.

Working Example

Example Snippetpython
import operatorprint(operator.pow(2, 5))
Python Reference