Python pow() Function

The pow() function in Python return the parameter ‘x’ to the power ‘y’ and if the parameter ‘z’ is present, it returns x to the power y, modulo z (computed more efficiently than pow(x, y) % z).

Syntax

Parameter

x: This parameter represents the base number.

y: This parameter represents the exponent number

z: It is an optional parameter that represents the modulus.

Return

This function returns x to the power y; if z is present, return x to the power y, modulo z.

Example 1

Output

Pin It on Pinterest

Share This