Python – Find x Raised to Power y – pow() Function with Examples

pow() function is used to find the x raised to the power y in Python for the given input(x – parameter).

 

Syntax of pow() Function

The syntax of pow() function in Python is:

math.pow(x, y)

 

Parameters of pow() Function in Python

x – Where x is any valid python number (positive or negative). This parameter is required.
Note: If the x parameter is not a number, pow() function will return an Error.

 

Compatibility

pow() function is available and compatible with both Python 2.x and 3.x. This function is a part of python standard math library.

 

Return Value of pow() Function in Python

pow() function returns x raised to the power y for the given input.

 

Python pow() Function Example

# import math library
import math
print(math.pow(-0.2))
print(math.pow(0))
print(math.pow(0.2))
print(math.pow(77))
print(math.pow(-3677))

Output: