About Lesson
pow():-
The pow(x,y) function returns the value of x raised to the power of y, i.e. xy.
Both pow() and the double star (**) operator perform exponentiation. ** is an operator and pow() is a built-in function.
Note:-1. ** operator, math.pow() converts both its arguments to type float.
-
use ** or the built in pow() function for computing exact integer powers.
Example:-
import math print(math.pow(2,2)) print(pow(2,2)) print(pow(2,-2)) |
Output 4.0 4 0.25 |