Syntax of pow() Function in Python

Syntax: pow(x, y, mod)

Parameters : 

  • x : Number whose power has to be calculated.
  • y : Value raised to compute power.
  • mod [optional]: if provided, performs modulus of mod on the result of x**y (i.e.: x**y % mod)

Return Value :  Returns the value x**y in float or int (depending upon input operands or 2nd argument).

Python pow() Function

Python pow() function returns the result of the first parameter raised to the power of the second parameter.

Similar Reads

Syntax of pow() Function in Python

Syntax: pow(x, y, mod) Parameters :  x : Number whose power has to be calculated. y : Value raised to compute power. mod [optional]: if provided, performs modulus of mod on the result of x**y (i.e.: x**y % mod) Return Value :  Returns the value x**y in float or int (depending upon input operands or 2nd argument)....

Python pow() Function Example

The pow() in Python is simple to use, just pass two values as the parameters....