Both pow() and the double star ( ** ) operator perform exponentiation; however, there are differences other than the fact that one is an operator and the other is a built-in function.
The ** operator did not appear until Python 1.5, and the pow() built-in takes an optional third parameter, a modulus argument. If provided, pow() will perform the exponentiation first, then return the result modulo the third argument. This feature is used for cryptographic applications and has better performance than pow(x,y) % z since the latter performs the calculations in Python rather than in C like pow(x, y, z).
>>> pow(2,5) 32 >>> pow(5,2) 25 >>> pow(3.141592,2) 9.869600294464002 >>> pow(1+1j,3) (-2+2j)